diff --git a/README.md b/README.md
index b4edbfb3b..1cbca3c83 100644
--- a/README.md
+++ b/README.md
@@ -64,7 +64,7 @@ You can set additional options:
Usage: js-slang [PROGRAM_STRING] [OPTION]
-c, --chapter=CHAPTER set the Source chapter number (i.e., 1-4) (default: 1)
- -v, --variant=VARIANT set the Source variant (i.e., default, interpreter, substituter, typed, concurrent, wasm) (default: default)
+ -v, --variant=VARIANT set the Source variant (i.e., default, interpreter, substituter, typed, wasm) (default: default)
-h, --help display this help
-e, --eval don't show REPL, only display output of evaluation
```
@@ -81,7 +81,6 @@ Currently, valid CHAPTER/VARIANT combinations are:
- `--chapter=2 --variant=interpreter`
- `--chapter=2 --variant=typed`
- `--chapter=3 --variant=default`
-- `--chapter=3 --variant=concurrent`
- `--chapter=3 --variant=interpreter`
- `--chapter=3 --variant=typed`
- `--chapter=4 --variant=default`
diff --git a/docs/lib/concurrency.js b/docs/lib/concurrency.js
deleted file mode 100644
index 75fa7c269..000000000
--- a/docs/lib/concurrency.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Setup multiple threads for concurrent execution. For each
- * function f_i
,
- * setup a thread t_i
that executes the body of
- * f_i
. Any parameters of f_i
refer
- * to undefined
during execution.
- * The thread that called concurrent_execute
- * runs concurrently with all t_i
. Returns
- * undefined
. This is an atomic operation.
- * @param {function} f_1,f_2,...,f_n - given functions
- * @returns {undefined} undefined
- */
-function concurrent_execute() {}
-
-/**
- * Assumes the head of pair p
is a boolean
- * b
. Sets the head of p
to
- * true
. Returns b
. This is an
- * atomic operation.
- * @param {array} p - given pair
- * @returns {value} - head of pair b
- */
-function test_and_set(p) {}
-
-/**
- * Sets the head of pair p
to
- * false
. Returns undefined
.
- * This is an atomic operation.
- * @param {array} p - given pair
- * @returns {undefined} undefined
- */
-function clear(p) {}
diff --git a/docs/md/README_3_CONCURRENT.md b/docs/md/README_3_CONCURRENT.md
deleted file mode 100644
index c4147ab00..000000000
--- a/docs/md/README_3_CONCURRENT.md
+++ /dev/null
@@ -1,62 +0,0 @@
-Source §3 Concurrent is a small programming language, designed for the third chapter
-of the textbook
-Structure and Interpretation
-of Computer Programs, JavaScript Adaptation (SICP JS).
-
-## What names are predeclared in Source §3 Concurrent?
-
-On the right, you see all predeclared names of Source §3 Concurrent, in alphabetical
-order. Click on a name to see how it is defined and used. They come in these groups:
-
- -
- AUXILIARY: Auxiliary constants and functions
-
- -
- MISC: Miscellaneous constants and functions
-
- -
- MATH: Mathematical constants and functions
-
- -
- LISTS: Support for lists
-
- -
- PAIRMUTATORS: Mutating pairs
-
- -
- ARRAYS: Support for arrays
-
- -
- STREAMS: Support for streams
-
- -
- CONCURRENCY: Support for concurrency
-
-
-
-## What can you do in Source §3 Concurrent?
-
-You can use all features of
-Source §3 and all
-features that are introduced in
-chapter 3.4 of the
-textbook.
-Below are the features that Source §3 Concurrent adds to Source §3.
-
-### Concurrency
-
-To introduce concurrency into your programs, you can use the
-functions in the CONCURRENCY library. The program
-runs concurrently with the threads that it creates. The program terminates when
-all threads terminate. Any result value from any of the threads, including the
-program's thread, are ignored. Use the predeclared `display` function to display
-result values.
-
-## You want the definitive specs?
-
-For our development team, we are maintaining a definitive description
-of the language, called the
-Specification of Source §3 Concurrent. Feel free to
-take a peek!
-
-
diff --git a/docs/md/README_CONCURRENCY.md b/docs/md/README_CONCURRENCY.md
deleted file mode 100644
index e3a1f28e7..000000000
--- a/docs/md/README_CONCURRENCY.md
+++ /dev/null
@@ -1,10 +0,0 @@
-CONCURRENCY provides three functions for introducing concurrency.
-Click on a name on the right to see how they are defined and used.
-
-Concurrency is covered in
-the textbook
-Structure and Interpretation
-of Computer Programs, JavaScript Adaptation (SICP JS)
-in
-section 3.4.2 Mechanisms for Controlling Concurrency.
-
diff --git a/docs/md/README_top.md b/docs/md/README_top.md
index 33aedac01..17e62e591 100644
--- a/docs/md/README_top.md
+++ b/docs/md/README_top.md
@@ -31,8 +31,6 @@ the members of our learning community.
#### Source §2 Typed
-#### Source §3 Concurrent
-
#### Source §3 Typed
#### Source §4 Typed
@@ -58,8 +56,6 @@ the Source Academy.
#### Specification of Source §2 Typed
-#### Specification of Source §3 Concurrent
-
#### Specification of Source §3 Typed
#### Specification of Source §4 Typed
diff --git a/docs/specs/Makefile b/docs/specs/Makefile
index 9c90edd42..30cf44087 100644
--- a/docs/specs/Makefile
+++ b/docs/specs/Makefile
@@ -1,6 +1,6 @@
PDFLATEX = latexmk -pdf
-SPECSNUMS = 1 1_wasm 1_type_inference 1_infinite_loop_detection 1_typed 2 2_typed 3_type_inference 3 3_concurrent 3_typed 4 4_explicitcontrol 4_typed styleguide 2_stepper studio_2 python_1
+SPECSNUMS = 1 1_wasm 1_type_inference 1_infinite_loop_detection 1_typed 2 2_typed 3_type_inference 3 3_typed 4 4_explicitcontrol 4_typed styleguide 2_stepper studio_2 python_1
SPECS = $(SPECSNUMS:%=source_%)
diff --git a/docs/specs/source_3_concurrent.tex b/docs/specs/source_3_concurrent.tex
deleted file mode 100644
index 6631becee..000000000
--- a/docs/specs/source_3_concurrent.tex
+++ /dev/null
@@ -1,106 +0,0 @@
-\input source_header.tex
-
-\begin{document}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \docheader{2021}{Source}{\S 3 Concurrent}{Jonathan Chan, Martin Henz, Koo Zhengqun}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\input source_intro.tex
-
-Source \S 3 Concurrent is a concurrent extension of Source \S 3.
-
-\section{Changes}
-
-Source \S 3 Concurrent modifies Source \S 3 in the following ways:
-\begin{itemize}
-\item Concurrency support functions are added, see Section~\textbf{Concurrency Support} on page \pageref{conc_supp}.
-\item The given program starts in a thread that runs concurrently with any
- threads that are created during the execution of the program.
-\item Neither the thread of the give program nor any other threads produce
- any values as results. Their effect is observable through \emph{side effects}
- such as calls of the \lstinline{display} primitive.
- \item Import directives are currently not supported.
-\end{itemize}
-\noindent
-The concurrency of Source \S 3 Concurrent is thread-based and deviates
-from the event-driven concurrency of
-\href{http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf}{\color{DarkBlue}
- ECMAScript 2018 ($9^{\textrm{th}}$ Edition)}. Source \S 3 Concurrent is
-motivated by Section 3.4 of the textbook
-\href{https://sourceacademy.org/sicpjs}{\color{DarkBlue}\emph{Structure and Interpretation
-of Computer Programs}, JavaScript Adaptation}.
-
-\section{Concurrency}
-
-We specify \emph{interleaving semantics} for Source \S 3 Concurrent.
-The effect of executing a Source \S 3 Concurrent program
-should be explainable as a single sequence of atomic actions. Each thread
-specifies a particular sequence of actions in a specific order,
-and the implementation is free to interleave the sequences of the threads
-into a single sequence, as long as the following conditions are met:
-\begin{enumerate}
-\item The order of actions within each thread is respected (sequential
- threads).
-\item Any action that is included in any thread's sequence of actions will
- eventually be executed (no starvation).
-\end{enumerate}
-\noindent
-The atomic actions are primitive steps such as accessing the value of a name,
-accessing a data structure, reducing a conditional expression or statement,
-carrying out a primitive operation or calling a function. Such atomic actions
-are considered \emph{uninterruptible}; they specify the \emph{granularity}
-of the concurrency.
-
-\input source_bnf.tex
-
-\newpage
-
-\input source_3_bnf_without_import.tex
-
-\newpage
-
-\input source_return
-
-\input source_boolean_operators
-
-\input source_loops
-
-\input source_names_lang
-
-\input source_numbers
-
-\input source_strings
-
-\input source_arrays
-
-\input source_comments
-
-\input source_typing_3
-
-\input source_standard
-
-\input source_misc
-
-\input source_math
-
-\input source_concurrency
-
-\input source_lists
-
-\input source_pair_mutators
-
-\input source_array_support
-
-\input source_streams
-
-\input source_js_differences
-
-\newpage
-
-\input source_list_library
-
-\newpage
-
-\input source_stream_library
-
- \end{document}
diff --git a/docs/specs/source_concurrency.tex b/docs/specs/source_concurrency.tex
deleted file mode 100644
index 632810695..000000000
--- a/docs/specs/source_concurrency.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\subsection*{Concurrency Support}
-\label{conc_supp}
-The following concurrency support is provided:
-
-\begin{itemize}
-\item \(\texttt{concurrent\_execute(}\texttt{f}_\texttt{1}, \cdots \texttt{f}_\texttt{n}\texttt{)}\): \(\textit{primitive}\), setup multiple threads for concurrent execution. For each nullary function \(\texttt{f}_\texttt{i}\) that returns \texttt{undefined}, setup a thread \(\texttt{t}_\texttt{i}\) that executes the code in the body of \(\texttt{f}_\texttt{i}\). The thread that called \texttt{concurrent\_execute} also executes concurrently with all \(\texttt{t}_\texttt{i}\). Returns \texttt{undefined}. This is an atomic operation.
-\item \texttt{test\_and\_set(p)}: \(\textit{primitive}\), assumes the head of pair \texttt{p} is a boolean \(b\). Sets the head of \texttt{p} to \texttt{true}. Returns \(b\). This is an atomic operation.
-\item \texttt{clear(p)}: \(\textit{primitive}\), sets the head of pair \texttt{p} to \texttt{false}. Returns \texttt{undefined}. This is an atomic operation.
-\end{itemize}
diff --git a/scripts/autocomplete.mjs b/scripts/autocomplete.mjs
index 34de8e977..d3e07482e 100644
--- a/scripts/autocomplete.mjs
+++ b/scripts/autocomplete.mjs
@@ -18,7 +18,6 @@ const TARGETS = [
"source_2",
"source_2_typed",
"source_3",
- "source_3_concurrent",
"source_3_typed",
"source_4",
"source_4_typed",
diff --git a/scripts/docs.mjs b/scripts/docs.mjs
index 70f0faef0..bd592b606 100644
--- a/scripts/docs.mjs
+++ b/scripts/docs.mjs
@@ -71,20 +71,6 @@ const configs = {
"pairmutator.js"
]
},
- "Source §3 Concurrent": {
- "readme": "README_3_CONCURRENT.md",
- "dst": "source_3_concurrent/",
- "libs": [
- "auxiliary.js",
- "misc.js",
- "math.js",
- "list.js",
- "stream.js",
- "array.js",
- "pairmutator.js",
- "concurrency.js"
- ]
- },
"Source §3 Typed": {
"readme": "README_3_TYPED.md",
"dst": "source_3_typed/",
@@ -190,13 +176,6 @@ const configs = {
"pairmutator.js"
]
},
- "CONCURRENCY": {
- "readme": "README_CONCURRENCY.md",
- "dst": "CONCURRENCY/",
- "libs": [
- "concurrency.js"
- ]
- },
"MCE": {
"readme": "README_MCE.md",
"dst": "MCE/",
diff --git a/src/__tests__/__snapshots__/block-scoping.ts.snap b/src/__tests__/__snapshots__/block-scoping.ts.snap
deleted file mode 100644
index dc267db9d..000000000
--- a/src/__tests__/__snapshots__/block-scoping.ts.snap
+++ /dev/null
@@ -1,216 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Cannot overwrite loop variables within a block: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let z = [];
- for (let x = 0; x < 2; x = x + 1) {
- x = 1;
- }
- return false;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Assignment to a for loop variable in the for loop is not allowed.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when accessing temporal dead zone: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const a = 1;
-function f() {
- display(a);
- const a = 5;
-}
-f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Name a declared later in current scope but not yet assigned",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`In a block, every going-to-be-defined variable in the block cannot be accessed until it has been defined in the block.: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const a = 1;
-{
- a + a;
- const a = 10;
-}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Name a declared later in current scope but not yet assigned",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No hoisting of functions. Only the name is hoisted like let and const: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const v = f();
-function f() {
- return 1;
-}
-v;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Name f declared later in current scope but not yet assigned",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Shadowed variables may not be assigned to until declared in the current scope: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let variable = 1;
-function test(){
- variable = 100;
- let variable = true;
- return variable;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Name variable not declared.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`const uses block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- const x = true;
- if(true) {
- const x = false;
- } else {
- const x = false;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`for loop \`let\` variables are copied into the block scope: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let z = [];
- for (let x = 0; x < 10; x = x + 1) {
- z[x] = () => x;
- }
- return z[1]();
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`for loops use block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let x = true;
- for (let x = 1; x > 0; x = x - 1) {
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`let uses block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let x = true;
- if(true) {
- let x = false;
- } else {
- let x = false;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`standalone block statements: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- const x = true;
- {
- const x = false;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`while loops use block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let x = true;
- while (true) {
- let x = false;
- break;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/__tests__/__snapshots__/display.ts.snap b/src/__tests__/__snapshots__/display.ts.snap
deleted file mode 100644
index 17d11e49e..000000000
--- a/src/__tests__/__snapshots__/display.ts.snap
+++ /dev/null
@@ -1,184 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`display can be used to display (escaped) strings: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(\\"Tom's assisstant said: \\\\\\"tuna.\\\\\\"\\");",
- "displayResult": Array [
- "\\"Tom's assisstant said: \\\\\\"tuna.\\\\\\"\\"",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "Tom's assisstant said: \\"tuna.\\"",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display can be used to display arrays: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display([1, 2, [4, 5]]);",
- "displayResult": Array [
- "[1, 2, [4, 5]]",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- 2,
- Array [
- 4,
- 5,
- ],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display can be used to display functions: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(x => x); display((x, y) => x + y);",
- "displayResult": Array [
- "x => x",
- "(x, y) => x + y",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": [Function],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display can be used to display funny numbers: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(1e38); display(NaN); display(Infinity);",
- "displayResult": Array [
- "1e+38",
- "NaN",
- "Infinity",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Infinity,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display can be used to display lists: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(list(1, 2));",
- "displayResult": Array [
- "[1, [2, null]]",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- Array [
- 2,
- null,
- ],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display can be used to display numbers: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(0);",
- "displayResult": Array [
- "0",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 0,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display can be used to display objects: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display({a: 1, b: 2, c: {d: 3}});",
- "displayResult": Array [
- "{\\"a\\": 1, \\"b\\": 2, \\"c\\": {\\"d\\": 3}}",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Object {
- "a": 1,
- "b": 2,
- "c": Object {
- "d": 3,
- },
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display second argument can be a string: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(31072020, \\"my_first_String\\");",
- "displayResult": Array [
- "my_first_String 31072020",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 31072020,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display throw error if second argument is non-string when used: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(31072020, 0xDEADC0DE);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: TypeError: display expects the second argument to be a string",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`display with no arguments throws an error: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 1 or more arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`raw_display can be used to display (unescaped) strings directly: expectDisplayResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "raw_display(\\"Tom's assisstant said: \\\\\\"tuna.\\\\\\"\\");",
- "displayResult": Array [
- "Tom's assisstant said: \\"tuna.\\"",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "Tom's assisstant said: \\"tuna.\\"",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/__tests__/__snapshots__/draw_data.ts.snap b/src/__tests__/__snapshots__/draw_data.ts.snap
deleted file mode 100644
index 065789fe5..000000000
--- a/src/__tests__/__snapshots__/draw_data.ts.snap
+++ /dev/null
@@ -1,49 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`draw_data returns first argument if exactly one argument: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "draw_data(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [
- Array [
- 1,
- ],
- ],
-}
-`;
-
-exports[`draw_data returns first argument if more than one argument: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "draw_data(1, 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [
- Array [
- 1,
- 2,
- ],
- ],
-}
-`;
-
-exports[`draw_data with no arguments throws error: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "draw_data();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 1 or more arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/__tests__/__snapshots__/index.ts.snap b/src/__tests__/__snapshots__/index.ts.snap
index 2339d62aa..6c7570d78 100644
--- a/src/__tests__/__snapshots__/index.ts.snap
+++ b/src/__tests__/__snapshots__/index.ts.snap
@@ -1,230 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Accessing array with nonexistent index returns undefined: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const a = [];
-a[1];",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Accessing object with nonexistent property returns undefined: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const o = {};
-o.nonexistent;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Allow display to return value it is displaying: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "25*(display(1+1));",
- "displayResult": Array [
- "2",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 50,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Array assignment has value: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let arr = [];
-const a = arr[0] = 1;
-const b = arr[1] = arr[2] = 4;
-arr[0] === 1 && arr[1] === 4 && arr[2] === 4;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Arrays toString matches up with JS: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "toString([1, 2]);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "1,2",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Arrow function definition returns itself: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "() => 42;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": [Function],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Arrow function infinite recursion with list args represents CallExpression well: expectParsedErrorNoErrorSnapshot 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = xs => append(f(xs), list());
-f(list(1, 2));",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Maximum call stack size exceeded
- f([1, [2, null]]).. f([1, [2, null]]).. f([1, [2, null]])..",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Assignment has value: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let a = 1;
-let b = a = 4;
-b === 4 && a === 4;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins hide their implementation when stringify: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(pair);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "function pair(left, right) {
- [implementation hidden]
-}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins hide their implementation when toString: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "toString(pair);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "function pair(left, right) {
- [implementation hidden]
-}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Can overwrite lets when assignment is allowed: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test() {
- let variable = false;
- variable = true;
- return variable;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Cannot overwrite consts even when assignment is allowed: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- const constant = 3;
- constant = 4;
- return constant;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Cannot assign new value to constant constant.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Deep object assignment and retrieval: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const o = {};
-o.a = {};
-o.a.b = {};
-o.a.b.c = \\"string\\";
-o.a.b.c;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "string",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Empty code returns undefined: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Factorial arrow function: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const fac = (i) => i === 1 ? 1 : i * fac(i-1);
-fac(5);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 120,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
exports[`Find arrow function declaration 1`] = `
SourceLocation {
"end": Position {
@@ -547,561 +322,3 @@ SourceLocation {
},
}
`;
-
-exports[`Function infinite recursion with list args represents CallExpression well: expectParsedErrorNoErrorSnapshot 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(xs) { return append(f(xs), list()); }
-f(list(1, 2));",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Maximum call stack size exceeded
- f([1, [2, null]]).. f([1, [2, null]]).. f([1, [2, null]])..",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Functions passed into non-source functions remain equal: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function t(x, y, z) {
- return x + y + z;
-}
-identity(t) === t && t(1, 2, 3) === 6;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Multiline string self-evaluates to itself: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\`1
-1\`;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "1
-1",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Objects toString matches up with JS: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "toString({a: 1});",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[object Object]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Rest parameters work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function rest(a, b, ...c) {
- let sum = a + b;
- for (let i = 0; i < array_length(c); i = i + 1) {
- sum = sum + c[i];
- }
- return sum;
-}
-rest(1, 2); // no error
-rest(1, 2, ...[3, 4, 5], ...[6, 7], ...[]);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 28,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Simple arrow function infinite recursion represents CallExpression well: expectParsedErrorNoErrorSnapshot 1`] = `
-Object {
- "alertResult": Array [],
- "code": "(x => x(x)(x))(x => x(x)(x));",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Maximum call stack size exceeded
- x(x => x(x)(x)).. x(x => x(x)(x)).. x(x => x(x)(x))..",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Simple function infinite recursion represents CallExpression well: expectParsedErrorNoErrorSnapshot 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {return x(x)(x);} f(f);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Maximum call stack size exceeded
- x(function f(x) {
- return x(x)(x);
-}).. x(function f(x) {
- return x(x)(x);
-}).. x(function f(x) {
- return x(x)(x);
-})..",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Simple object assignment and retrieval: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const o = {};
-o.a = 1;
-o.a;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Single boolean self-evaluates to itself: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Single number self-evaluates to itself: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "42;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 42,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Single string self-evaluates to itself: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "'42';",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "42",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test apply_in_underlying_javascript: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "apply_in_underlying_javascript((a, b, c) => a * b * c, list(2, 5, 6));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 60,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test context reuse: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let i = 0;
-function f() {
- i = i + 1;
- return i;
-}
-i;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 0,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test context reuse: expectResult 2`] = `
-Object {
- "alertResult": Array [],
- "code": "i = 100; f();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 101,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test context reuse: expectResult 3`] = `
-Object {
- "alertResult": Array [],
- "code": "f(); i;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 102,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test context reuse: expectResult 4`] = `
-Object {
- "alertResult": Array [],
- "code": "i;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 102,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test equal for different lists: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "!equal(list(1, 2), pair(1, 2)) && !equal(list(1, 2, 3), list(1, list(2, 3)));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test equal for lists: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "equal(list(1, 2), pair(1, pair(2, null))) && equal(list(1, 2, 3, 4), list(1, 2, 3, 4));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Test equal for primitives: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "equal(1, 1) && equal(\\"str\\", \\"str\\") && equal(null, null) && !equal(1, 2) && !equal(\\"str\\", \\"\\");",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`false if with empty else works: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "if (false) {
-} else {
-}",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`false if with nonempty if works: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "if (false) {
-} else {
- 2;
-}",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`functions toString (mostly) matches up with JS: expect to loosely match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return 5;
-}
-toString(a=>a) + toString(f);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "a => afunction f(x) {
- return 5;
-}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`parseError for missing semicolon: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "42",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Missing semicolon at the end of statement",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`parseError for template literals with expressions: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\`\${1}\`;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expressions are not allowed in template literals (\`multiline strings\`)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`primitives toString matches up with JS: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "toString(true) +
-toString(false) +
-toString(1) +
-toString(1.5) +
-toString(null) +
-toString(undefined) +
-toString(NaN);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "truefalse11.5nullundefinedNaN",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test && shortcircuiting: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "false && 1();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test || shortcircuiting: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true || 1();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test false && false: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "false && false;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test false && true: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "false && true;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test false || false: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "false || false;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test false || true: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "false || true;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test false conditional expression: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "false ? true : false;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test true && false: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true && false;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test true && true: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true && true;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test true || false: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true || false;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test true || true: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true || true;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`test true conditional expression: expect to match JS 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true ? true : false;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`true if with empty if works: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "if (true) {
-} else {
-}",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`true if with nonempty if works: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "if (true) {
- 1;
-} else {
-}",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/__tests__/__snapshots__/inspect.ts.snap b/src/__tests__/__snapshots__/inspect.ts.snap
deleted file mode 100644
index ee1749372..000000000
--- a/src/__tests__/__snapshots__/inspect.ts.snap
+++ /dev/null
@@ -1,2761 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`debugger; pauses for 1`] = `
-Object {
- "head": Object {
- "i": 0,
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses for 2`] = `
-Object {
- "head": Object {
- "_copy_of_i": 0,
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses for 3`] = `
-Object {
- "head": Object {
- "i": 0,
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses for 4`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 10,
- },
- ],
- "callee": Node {
- "end": 78,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "name": "a",
- "start": 77,
- "type": "Identifier",
- },
- "end": 82,
- "loc": SourceLocation {
- "end": Position {
- "column": 7,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "start": 77,
- "type": "CallExpression",
- },
- "head": Object {
- "x": 10,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses for 5`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses for 6`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses for 7`] = `""`;
-
-exports[`debugger; pauses while 1`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 10,
- },
- ],
- "callee": Node {
- "end": 78,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 8,
- },
- "start": Position {
- "column": 2,
- "line": 8,
- },
- },
- "name": "a",
- "start": 77,
- "type": "Identifier",
- },
- "end": 82,
- "loc": SourceLocation {
- "end": Position {
- "column": 7,
- "line": 8,
- },
- "start": Position {
- "column": 2,
- "line": 8,
- },
- },
- "start": 77,
- "type": "CallExpression",
- },
- "head": Object {
- "x": 10,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses while 2`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses while 3`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; pauses while 4`] = `""`;
-
-exports[`debugger; statement basic test 1`] = `
-Object {
- "head": Object {
- "a": 2,
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement basic test 2`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement basic test 3`] = `""`;
-
-exports[`debugger; statement execution sequence 1`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement execution sequence 2`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement execution sequence 3`] = `""`;
-
-exports[`debugger; statement hoisting 1`] = `
-Object {
- "head": Object {
- "b": Symbol(Used to implement hoisting),
- "c": Symbol(Used to implement hoisting),
- "z": Symbol(Used to implement hoisting),
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement hoisting 2`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 10,
- },
- ],
- "callee": Node {
- "end": 108,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 9,
- },
- "start": Position {
- "column": 2,
- "line": 9,
- },
- },
- "name": "a",
- "start": 107,
- "type": "Identifier",
- },
- "end": 112,
- "loc": SourceLocation {
- "end": Position {
- "column": 7,
- "line": 9,
- },
- "start": Position {
- "column": 2,
- "line": 9,
- },
- },
- "start": 107,
- "type": "CallExpression",
- },
- "head": Object {
- "x": 10,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement hoisting 3`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement hoisting 4`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement hoisting 5`] = `""`;
-
-exports[`debugger; statement in function 1`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 10,
- },
- ],
- "callee": Node {
- "end": 53,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 6,
- },
- "start": Position {
- "column": 2,
- "line": 6,
- },
- },
- "name": "a",
- "start": 52,
- "type": "Identifier",
- },
- "end": 57,
- "loc": SourceLocation {
- "end": Position {
- "column": 7,
- "line": 6,
- },
- "start": Position {
- "column": 2,
- "line": 6,
- },
- },
- "start": 52,
- "type": "CallExpression",
- },
- "head": Object {
- "x": 10,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement in function 2`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement in function 3`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement in function 4`] = `""`;
-
-exports[`debugger; statement test function scope 1`] = `
-Object {
- "head": Object {
- "b": 100,
- "c": 200,
- "d": 300,
- "e": 30000,
- "f": 60000,
- "g": 2000,
- "h": 2300,
- "i": 666.6666666666666,
- "j": 600,
- "k": 0.0033333333333333335,
- "l": 0.5,
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement test function scope 2`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 10,
- },
- ],
- "callee": Node {
- "end": 266,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 17,
- },
- "start": Position {
- "column": 2,
- "line": 17,
- },
- },
- "name": "a",
- "start": 265,
- "type": "Identifier",
- },
- "end": 270,
- "loc": SourceLocation {
- "end": Position {
- "column": 7,
- "line": 17,
- },
- "start": Position {
- "column": 2,
- "line": 17,
- },
- },
- "start": 265,
- "type": "CallExpression",
- },
- "head": Object {
- "x": 10,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement test function scope 3`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement test function scope 4`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`debugger; statement test function scope 5`] = `""`;
-
-exports[`setBreakpointAtLine basic 1`] = `
-Object {
- "head": Object {
- "a": Symbol(Used to implement hoisting),
- "b": Symbol(Used to implement hoisting),
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine basic 2`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine basic 3`] = `""`;
-
-exports[`setBreakpointAtLine for loops 1`] = `
-Object {
- "head": Object {
- "b": Symbol(Used to implement hoisting),
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine for loops 2`] = `
-Object {
- "head": Object {
- "i": 1,
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine for loops 3`] = `
-Object {
- "head": Object {
- "_copy_of_i": 1,
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine for loops 4`] = `
-Object {
- "head": Object {
- "i": 1,
- },
- "id": Any,
- "name": "blockEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine for loops 5`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine for loops 6`] = `""`;
-
-exports[`setBreakpointAtLine for loops 7`] = `
-Array [
- Object {
- "head": Object {
- "b": Symbol(Used to implement hoisting),
- },
- "id": "95",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "i": 2,
- },
- "id": "94",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "_copy_of_i": 2,
- },
- "id": "93",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "i": 2,
- },
- "id": "89",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "87",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine for loops 8`] = `""`;
-
-exports[`setBreakpointAtLine for loops 9`] = `
-Array [
- Object {
- "head": Object {
- "b": Symbol(Used to implement hoisting),
- },
- "id": "98",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "i": 4,
- },
- "id": "97",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "_copy_of_i": 4,
- },
- "id": "96",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "i": 4,
- },
- "id": "89",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "87",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine for loops 10`] = `""`;
-
-exports[`setBreakpointAtLine for loops 11`] = `
-Array [
- Object {
- "head": Object {
- "b": Symbol(Used to implement hoisting),
- },
- "id": "101",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "i": 8,
- },
- "id": "100",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "_copy_of_i": 8,
- },
- "id": "99",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "i": 8,
- },
- "id": "89",
- "name": "blockEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "87",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine for loops 12`] = `""`;
-
-exports[`setBreakpointAtLine for loops 13`] = `
-Array [
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "87",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine for loops 14`] = `""`;
-
-exports[`setBreakpointAtLine function 1 1`] = `
-Object {
- "head": Object {
- "a": Symbol(Used to implement hoisting),
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 1 2`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 1 3`] = `""`;
-
-exports[`setBreakpointAtLine function 2 1`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": "bob",
- },
- ],
- "callee": Node {
- "end": 43,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 5,
- },
- "start": Position {
- "column": 2,
- "line": 5,
- },
- },
- "name": "a",
- "start": 42,
- "type": "Identifier",
- },
- "end": 50,
- "loc": SourceLocation {
- "end": Position {
- "column": 10,
- "line": 5,
- },
- "start": Position {
- "column": 2,
- "line": 5,
- },
- },
- "start": 42,
- "type": "CallExpression",
- },
- "head": Object {
- "x": "bob",
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 2 2`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 2 3`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 2 4`] = `""`;
-
-exports[`setBreakpointAtLine function 3 1`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 3 2`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 3 3`] = `""`;
-
-exports[`setBreakpointAtLine function 4 1`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 4 2`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine function 4 3`] = `""`;
-
-exports[`setBreakpointAtLine granularity 1 1`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 1,
- },
- ],
- "callee": Node {
- "end": 78,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "name": "a",
- "start": 77,
- "type": "Identifier",
- },
- "end": 81,
- "loc": SourceLocation {
- "end": Position {
- "column": 6,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "start": 77,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 1,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 1 2`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 1 3`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 1 4`] = `""`;
-
-exports[`setBreakpointAtLine granularity 1 5`] = `
-Array [
- Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": -1,
- },
- ],
- "callee": Node {
- "end": 58,
- "loc": SourceLocation {
- "end": Position {
- "column": 5,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "name": "a",
- "start": 57,
- "type": "Identifier",
- },
- "end": 69,
- "loc": SourceLocation {
- "end": Position {
- "column": 16,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "start": 57,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": -1,
- },
- "id": "62",
- "name": "a",
- "tail": null,
- },
- Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 0,
- },
- ],
- "callee": Node {
- "end": 58,
- "loc": SourceLocation {
- "end": Position {
- "column": 5,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "name": "a",
- "start": 57,
- "type": "Identifier",
- },
- "end": 69,
- "loc": SourceLocation {
- "end": Position {
- "column": 16,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "start": 57,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 0,
- },
- "id": "59",
- "name": "a",
- "tail": null,
- },
- Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 1,
- },
- ],
- "callee": Node {
- "end": 78,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "name": "a",
- "start": 77,
- "type": "Identifier",
- },
- "end": 81,
- "loc": SourceLocation {
- "end": Position {
- "column": 6,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "start": 77,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 1,
- },
- "id": "56",
- "name": "a",
- "tail": null,
- },
- Object {
- "head": Object {
- "a": [Function],
- },
- "id": "55",
- "name": "programEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "54",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine granularity 1 6`] = `""`;
-
-exports[`setBreakpointAtLine granularity 2 1`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": -1,
- },
- ],
- "callee": Node {
- "end": 58,
- "loc": SourceLocation {
- "end": Position {
- "column": 5,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "name": "a",
- "start": 57,
- "type": "Identifier",
- },
- "end": 69,
- "loc": SourceLocation {
- "end": Position {
- "column": 16,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "start": 57,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": -1,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 2 2`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 0,
- },
- ],
- "callee": Node {
- "end": 58,
- "loc": SourceLocation {
- "end": Position {
- "column": 5,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "name": "a",
- "start": 57,
- "type": "Identifier",
- },
- "end": 69,
- "loc": SourceLocation {
- "end": Position {
- "column": 16,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "start": 57,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 0,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 2 3`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 1,
- },
- ],
- "callee": Node {
- "end": 78,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "name": "a",
- "start": 77,
- "type": "Identifier",
- },
- "end": 81,
- "loc": SourceLocation {
- "end": Position {
- "column": 6,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "start": 77,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 1,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 2 4`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 2 5`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 2 6`] = `""`;
-
-exports[`setBreakpointAtLine granularity 2 7`] = `
-Array [
- Object {
- "head": Object {
- "a": [Function],
- },
- "id": "66",
- "name": "programEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "65",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine granularity 2 8`] = `""`;
-
-exports[`setBreakpointAtLine granularity 3 1`] = `
-Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 1,
- },
- ],
- "callee": Node {
- "end": 78,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "name": "a",
- "start": 77,
- "type": "Identifier",
- },
- "end": 81,
- "loc": SourceLocation {
- "end": Position {
- "column": 6,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "start": 77,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 1,
- },
- "id": Any,
- "name": "a",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 3 2`] = `
-Object {
- "head": Object {
- "a": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 3 3`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine granularity 3 4`] = `""`;
-
-exports[`setBreakpointAtLine granularity 3 5`] = `
-Array [
- Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 0,
- },
- ],
- "callee": Node {
- "end": 58,
- "loc": SourceLocation {
- "end": Position {
- "column": 5,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "name": "a",
- "start": 57,
- "type": "Identifier",
- },
- "end": 69,
- "loc": SourceLocation {
- "end": Position {
- "column": 16,
- "line": 5,
- },
- "start": Position {
- "column": 4,
- "line": 5,
- },
- },
- "start": 57,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 0,
- },
- "id": "81",
- "name": "a",
- "tail": null,
- },
- Object {
- "callExpression": Object {
- "arguments": Array [
- Object {
- "loc": undefined,
- "type": "Literal",
- "value": 1,
- },
- ],
- "callee": Node {
- "end": 78,
- "loc": SourceLocation {
- "end": Position {
- "column": 3,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "name": "a",
- "start": 77,
- "type": "Identifier",
- },
- "end": 81,
- "loc": SourceLocation {
- "end": Position {
- "column": 6,
- "line": 7,
- },
- "start": Position {
- "column": 2,
- "line": 7,
- },
- },
- "start": 77,
- "type": "CallExpression",
- },
- "head": Object {
- "ctrlf": 1,
- },
- "id": "78",
- "name": "a",
- "tail": null,
- },
- Object {
- "head": Object {
- "a": [Function],
- },
- "id": "77",
- "name": "programEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "76",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine granularity 3 6`] = `""`;
-
-exports[`setBreakpointAtLine granularity 3 7`] = `
-Array [
- Object {
- "head": Object {
- "a": [Function],
- },
- "id": "77",
- "name": "programEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "76",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine granularity 3 8`] = `""`;
-
-exports[`setBreakpointAtLine while loops 1`] = `
-Object {
- "head": Object {
- "a": 9,
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine while loops 2`] = `
-Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": Any,
- "name": "programEnvironment",
- "tail": null,
-}
-`;
-
-exports[`setBreakpointAtLine while loops 3`] = `""`;
-
-exports[`setBreakpointAtLine while loops 4`] = `
-Array [
- Object {
- "head": Object {
- "a": 6,
- },
- "id": "103",
- "name": "programEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "102",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine while loops 5`] = `""`;
-
-exports[`setBreakpointAtLine while loops 6`] = `
-Array [
- Object {
- "head": Object {
- "a": 3,
- },
- "id": "103",
- "name": "programEnvironment",
- "tail": null,
- },
- Object {
- "head": Object {
- "$accumulate": [Function],
- "$append": [Function],
- "$build_list": [Function],
- "$enum_list": [Function],
- "$filter": [Function],
- "$length": [Function],
- "$list_to_string": [Function],
- "$map": [Function],
- "$remove": [Function],
- "$remove_all": [Function],
- "$reverse": [Function],
- "__access_export__": [Function],
- "__access_named_export__": [Function],
- "accumulate": [Function],
- "append": [Function],
- "build_list": [Function],
- "build_stream": [Function],
- "enum_list": [Function],
- "enum_stream": [Function],
- "equal": [Function],
- "eval_stream": [Function],
- "filter": [Function],
- "for_each": [Function],
- "integers_from": [Function],
- "is_stream": [Function],
- "length": [Function],
- "list_ref": [Function],
- "list_to_stream": [Function],
- "list_to_string": [Function],
- "map": [Function],
- "member": [Function],
- "remove": [Function],
- "remove_all": [Function],
- "reverse": [Function],
- "stream_append": [Function],
- "stream_filter": [Function],
- "stream_for_each": [Function],
- "stream_length": [Function],
- "stream_map": [Function],
- "stream_member": [Function],
- "stream_ref": [Function],
- "stream_remove": [Function],
- "stream_remove_all": [Function],
- "stream_reverse": [Function],
- "stream_to_list": [Function],
- },
- "id": "102",
- "name": "programEnvironment",
- "tail": null,
- },
-]
-`;
-
-exports[`setBreakpointAtLine while loops 7`] = `""`;
diff --git a/src/__tests__/__snapshots__/return-regressions.ts.snap b/src/__tests__/__snapshots__/return-regressions.ts.snap
deleted file mode 100644
index 4a6940382..000000000
--- a/src/__tests__/__snapshots__/return-regressions.ts.snap
+++ /dev/null
@@ -1,359 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Bare early returns in for loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- for (let i = 0; i < 100; i = i + 1) {
- return i+1;
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Bare early returns in if statements work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- if (true) {
- return 1;
- unreachable();
- } else {}
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Bare early returns in while loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- while (true) {
- return 1;
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Bare early returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- return 1;
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Calling unreachable results in error: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- unreachable();
- return 0;
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Expected number on right hand side of operation, got boolean.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns in for loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- for (let i = 0; i < 100; i = i + 1) {
- return id(i+1) + id(i+2);
- }
- return 0;
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns in if statements work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- if (true) {
- return id(1) + id(2);
- unreachable();
- } else {}
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns in while loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- while (true) {
- return id(1) + id(2);
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- return id(1) + id(2);
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns in for loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- for (let i = 0; i < 100; i = i + 1) {
- return id(i+1);
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns in if statements work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- if (true) {
- return id(1);
- unreachable();
- } else {}
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns in while loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- while (true) {
- return id(1);
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- return id(1);
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/__tests__/__snapshots__/stdlib.ts.snap b/src/__tests__/__snapshots__/stdlib.ts.snap
index 6bfca218b..2efb0a3ad 100644
--- a/src/__tests__/__snapshots__/stdlib.ts.snap
+++ b/src/__tests__/__snapshots__/stdlib.ts.snap
@@ -1,829 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Builtins work as expected 0: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display('message');",
- "displayResult": Array [
- "\\"message\\"",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "message",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 1 1`] = `"Line 1: Error: \\"error!\\""`;
-exports[`Builtins work as expected 1: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "error('error!');",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: \\"error!\\"",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 56 1`] = `"Line 1: Error: head(xs) expects a pair as argument xs, but encountered null"`;
-exports[`Builtins work as expected 2: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_undefined(undefined);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 57 1`] = `"Line 1: Error: tail(xs) expects a pair as argument xs, but encountered null"`;
-exports[`Builtins work as expected 3: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_undefined(null);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 58 1`] = `"Line 1: Error: head(xs) expects a pair as argument xs, but encountered 1"`;
-exports[`Builtins work as expected 4: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_null(undefined);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 59 1`] = `"Line 1: Error: tail(xs) expects a pair as argument xs, but encountered 1"`;
-exports[`Builtins work as expected 5: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_null(null);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 6: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string('string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 7: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string('true');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 8: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string('1');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 9: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string(true);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 10: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 11: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number('string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 12: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number('true');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 13: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number('1');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 14: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(true);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 15: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 16: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean('string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 17: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean('true');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 18: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean('1');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 19: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean(true);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 20: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 21: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_function(display);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 22: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_function(x => x);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 23: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return x;
-}
-is_function(f);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 24: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_function(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 25: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_array(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 26: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_array(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 27: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_array([1]);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 28: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 29: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 30: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object([1]);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 31: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object({});",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 32: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object({a: 1});",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 33: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object(x => x);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 34: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object(display);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 35: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 36: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object('string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 37: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_object(true);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 38: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_NaN(1 / 0);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 39: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_NaN(NaN);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 40: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_NaN(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 41: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_NaN(x => x);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 42: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "has_own_property({a: 1, b: 2}, 'a');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 43: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "has_own_property({a: 1, b: 2}, 'c');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 44: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "array_length([1]);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 45: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int('10', 10);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 46: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int('10', 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 47: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(get_time());",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 48: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const start = get_time();
-function repeatUntilDifferentTime() {
- if (start === get_time()) {
- return repeatUntilDifferentTime();
- } else {
- return true;
- }
-}
-repeatUntilDifferentTime();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 49: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "pair(1, 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- 2,
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 50: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "list(1, 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- Array [
- 2,
- null,
- ],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 51: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_list(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 52: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_list(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 53: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_list(list(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 54: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "head(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 55: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "tail(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 56: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "head(null);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: head(xs) expects a pair as argument xs, but encountered null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 57: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "tail(null);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: tail(xs) expects a pair as argument xs, but encountered null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 58: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "head(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: head(xs) expects a pair as argument xs, but encountered 1",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 59: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "tail(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: tail(xs) expects a pair as argument xs, but encountered 1",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 60: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "length(list(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 61: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "length(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 33: Error: tail(xs) expects a pair as argument xs, but encountered 1",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 61 1`] = `"Line 33: Error: tail(xs) expects a pair as argument xs, but encountered 1"`;
diff --git a/src/__tests__/__snapshots__/stringify.ts.snap b/src/__tests__/__snapshots__/stringify.ts.snap
deleted file mode 100644
index 609e54290..000000000
--- a/src/__tests__/__snapshots__/stringify.ts.snap
+++ /dev/null
@@ -1,543 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Correctly handles circular structures with multiple entry points: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const x = enum_list(1, 3);
-set_tail(tail(tail(x)), x);
-stringify(list(x, tail(x), tail(tail(x))));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[ [1, [2, [3, ...]]],
-[[2, [3, [1, ...]]], [[3, [1, [2, ...]]], null]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of arrays are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const xs = [1, 'true', true, () => 1];
-stringify(xs);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[1, \\"true\\", true, () => 1]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of arrow functions are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (x, y) => x;
-stringify(f);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "(x, y) => x",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of big objects are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const o = { a: 1, b: true, c: () => 1, d: { e: 5, f: 6 }, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0, m: 0, n: 0};
-stringify(o);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "{ \\"a\\": 1,
- \\"b\\": true,
- \\"c\\": () => 1,
- \\"d\\": {\\"e\\": 5, \\"f\\": 6},
- \\"g\\": 0,
- \\"h\\": 0,
- \\"i\\": 0,
- \\"j\\": 0,
- \\"k\\": 0,
- \\"l\\": 0,
- \\"m\\": 0,
- \\"n\\": 0}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of booleans are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify('true');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "\\"true\\"",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of builtins are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(pair);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "function pair(left, right) {
- [implementation hidden]
-}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of empty arrays are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const xs = [];
-stringify(xs);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of functions are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- return x;
-}
-stringify(f);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "function f(x, y) {
- return x;
-}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of huge arrays are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const arr = [];
-for (let i = 0; i < 100; i = i + 1) {
- arr[i] = i;
-}
-stringify(arr);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[ 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 10,
- 11,
- 12,
- 13,
- 14,
- 15,
- 16,
- 17,
- 18,
- 19,
- 20,
- 21,
- 22,
- 23,
- 24,
- 25,
- 26,
- 27,
- 28,
- 29,
- 30,
- 31,
- 32,
- 33,
- 34,
- 35,
- 36,
- 37,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 46,
- 47,
- 48,
- 49,
- 50,
- 51,
- 52,
- 53,
- 54,
- 55,
- 56,
- 57,
- 58,
- 59,
- 60,
- 61,
- 62,
- 63,
- 64,
- 65,
- 66,
- 67,
- 68,
- 69,
- 70,
- 71,
- 72,
- 73,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 82,
- 83,
- 84,
- 85,
- 86,
- 87,
- 88,
- 89,
- 90,
- 91,
- 92,
- 93,
- 94,
- 95,
- 96,
- 97,
- 98,
- 99]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of huge lists are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(enum_list(1, 100));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[ 1,
-[ 2,
-[ 3,
-[ 4,
-[ 5,
-[ 6,
-[ 7,
-[ 8,
-[ 9,
-[ 10,
-[ 11,
-[ 12,
-[ 13,
-[ 14,
-[ 15,
-[ 16,
-[ 17,
-[ 18,
-[ 19,
-[ 20,
-[ 21,
-[ 22,
-[ 23,
-[ 24,
-[ 25,
-[ 26,
-[ 27,
-[ 28,
-[ 29,
-[ 30,
-[ 31,
-[ 32,
-[ 33,
-[ 34,
-[ 35,
-[ 36,
-[ 37,
-[ 38,
-[ 39,
-[ 40,
-[ 41,
-[ 42,
-[ 43,
-[ 44,
-[ 45,
-[ 46,
-[ 47,
-[ 48,
-[ 49,
-[ 50,
-[ 51,
-[ 52,
-[ 53,
-[ 54,
-[ 55,
-[ 56,
-[ 57,
-[ 58,
-[ 59,
-[ 60,
-[ 61,
-[ 62,
-[ 63,
-[ 64,
-[ 65,
-[ 66,
-[ 67,
-[ 68,
-[ 69,
-[ 70,
-[ 71,
-[ 72,
-[ 73,
-[ 74,
-[ 75,
-[ 76,
-[ 77,
-[ 78,
-[ 79,
-[ 80,
-[ 81,
-[ 82,
-[ 83,
-[ 84,
-[ 85,
-[ 86,
-[ 87,
-[ 88,
-[89, [90, [91, [92, [93, [94, [95, [96, [97, [98, [99, [100, null]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of lists are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(enum_list(1, 10));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[1, [2, [3, [4, [5, [6, [7, [8, [9, [10, null]]]]]]]]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of multidimensional arrays are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const xs = [1, 'true', [true, () => 1, [[]]]];
-stringify(xs);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[1, \\"true\\", [true, () => 1, [[]]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of nested objects are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const o = { a: 1, b: true, c: () => 1, d: { e: 5, f: 6 } };
-stringify(o);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "{\\"a\\": 1, \\"b\\": true, \\"c\\": () => 1, \\"d\\": {\\"e\\": 5, \\"f\\": 6}}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of nested objects are nice: expectResult 2`] = `
-Object {
- "alertResult": Array [],
- "code": "let o = {};
-o.o = o;
-stringify(o);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "{\\"o\\": ...}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of null is nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(null);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "null",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of numbers are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(0);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "0",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of objects are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const o = { a: 1, b: true, c: () => 1 };
-stringify(o);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "{\\"a\\": 1, \\"b\\": true, \\"c\\": () => 1}",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of objects with toReplString member calls toReplString: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const o = { toReplString: () => '' };
-stringify(o);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of strings are nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify('a string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "\\"a string\\"",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation of undefined is nice: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(undefined);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "undefined",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation with 1 space indent: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(parse('x=>x;'), 1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[\\"lambda_expression\\",
-[[[\\"name\\", [\\"x\\", null]], null],
-[[\\"return_statement\\", [[\\"name\\", [\\"x\\", null]], null]], null]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation with default (2 space) indent: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(parse('x=>x;'));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[ \\"lambda_expression\\",
-[ [[\\"name\\", [\\"x\\", null]], null],
-[[\\"return_statement\\", [[\\"name\\", [\\"x\\", null]], null]], null]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation with more than 10 space indent should trim to 10 space indent: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(parse('x=>x;'), 100);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[ \\"lambda_expression\\",
-[ [[\\"name\\", [\\"x\\", null]], null],
-[[\\"return_statement\\", [[\\"name\\", [\\"x\\", null]], null]], null]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`String representation with no indent: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(parse('x=>x;'), 0);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "[\\"lambda_expression\\",
-[[[\\"name\\", [\\"x\\", null]], null],
-[[\\"return_statement\\", [[\\"name\\", [\\"x\\", null]], null]], null]]]",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/__tests__/__snapshots__/tailcall-return.ts.snap b/src/__tests__/__snapshots__/tailcall-return.ts.snap
deleted file mode 100644
index 2ebb65935..000000000
--- a/src/__tests__/__snapshots__/tailcall-return.ts.snap
+++ /dev/null
@@ -1,169 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Simple tail call returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+1);
- }
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call in boolean operators work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return false || f(x-1, y+1);
- }
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call in conditional expressions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- return x <= 0 ? y : f(x-1, y+1);
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call in nested mix of conditional expressions boolean operators work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- return x <= 0 ? y : false || x > 0 ? f(x-1, y+1) : 'unreachable';
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in arrow block functions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (x, y) => {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+1);
- }
-};
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in arrow functions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (x, y) => x <= 0 ? y : f(x-1, y+1);
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in mixed tail-call/non-tail-call recursion work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y, z) {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+f(0, z, 0), z);
- }
-}
-f(5000, 5000, 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 15000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in mutual recursion with arrow functions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (x, y) => x <= 0 ? y : g(x-1, y+1);
-const g = (x, y) => x <= 0 ? y : f(x-1, y+1);
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in mutual recursion work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return g(x-1, y+1);
- }
-}
-function g(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+1);
- }
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/__tests__/block-scoping.ts b/src/__tests__/block-scoping.ts
index d7de4b3fb..9066b8128 100644
--- a/src/__tests__/block-scoping.ts
+++ b/src/__tests__/block-scoping.ts
@@ -14,8 +14,7 @@ test('standalone block statements', () => {
return x;
}
test();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`true`)
})
@@ -33,8 +32,7 @@ test('const uses block scoping instead of function scoping', () => {
return x;
}
test();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`true`)
})
@@ -53,7 +51,7 @@ test('let uses block scoping instead of function scoping', () => {
}
test();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`true`)
})
@@ -69,7 +67,7 @@ test('for loops use block scoping instead of function scoping', () => {
}
test();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`true`)
})
@@ -87,7 +85,7 @@ test('while loops use block scoping instead of function scoping', () => {
}
test();
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toMatchInlineSnapshot(`true`)
})
@@ -105,7 +103,7 @@ test('for loop `let` variables are copied into the block scope', () => {
}
test();
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toMatchInlineSnapshot(`1`)
})
@@ -134,9 +132,7 @@ test('No hoisting of functions. Only the name is hoisted like let and const', ()
return 1;
}
v;
- `).toMatchInlineSnapshot(
- `"Line 1: Name f declared later in current scope but not yet assigned"`
- )
+ `).toMatchInlineSnapshot(`"Line 1: ReferenceError: Cannot access 'f' before initialization"`)
}, 30000)
test('Error when accessing temporal dead zone', () => {
@@ -147,9 +143,7 @@ test('Error when accessing temporal dead zone', () => {
const a = 5;
}
f();
- `).toMatchInlineSnapshot(
- `"Line 3: Name a declared later in current scope but not yet assigned"`
- )
+ `).toMatchInlineSnapshot(`"Line 3: ReferenceError: Cannot access 'a' before initialization"`)
}, 30000)
// tslint:disable-next-line:max-line-length
@@ -160,9 +154,7 @@ test('In a block, every going-to-be-defined variable in the block cannot be acce
a + a;
const a = 10;
}
- `).toMatchInlineSnapshot(
- `"Line 3: Name a declared later in current scope but not yet assigned"`
- )
+ `).toMatchInlineSnapshot(`"Line 3: ReferenceError: Cannot access 'a' before initialization"`)
}, 30000)
test('Shadowed variables may not be assigned to until declared in the current scope', () => {
@@ -177,5 +169,7 @@ test('Shadowed variables may not be assigned to until declared in the current sc
test();
`,
{ chapter: Chapter.SOURCE_3 }
- ).toMatchInlineSnapshot(`"Line 3: Name variable not declared."`)
+ ).toMatchInlineSnapshot(
+ `"Line 3: ReferenceError: Cannot access 'variable' before initialization"`
+ )
})
diff --git a/src/__tests__/display.ts b/src/__tests__/display.ts
index a3d053abf..3626f8d75 100644
--- a/src/__tests__/display.ts
+++ b/src/__tests__/display.ts
@@ -8,88 +8,55 @@ test('display throw error if second argument is non-string when used', () => {
})
test('display second argument can be a string', () => {
- return expectDisplayResult(`display(31072020, "my_first_String");`, { native: true })
- .toMatchInlineSnapshot(`
- Array [
- "my_first_String 31072020",
- ]
- `)
+ return expectDisplayResult(`display(31072020, "my_first_String");`).toMatchInlineSnapshot(
+ `Array []`
+ )
})
test('display can be used to display numbers', () => {
- return expectDisplayResult(`display(0);`, { native: true }).toMatchInlineSnapshot(`
-Array [
- "0",
-]
-`)
+ return expectDisplayResult(`display(0);`).toMatchInlineSnapshot(`Array []`)
})
test('display can be used to display funny numbers', () => {
- return expectDisplayResult(`display(1e38); display(NaN); display(Infinity);`, { native: true })
- .toMatchInlineSnapshot(`
-Array [
- "1e+38",
- "NaN",
- "Infinity",
-]
-`)
+ return expectDisplayResult(
+ `display(1e38); display(NaN); display(Infinity);`
+ ).toMatchInlineSnapshot(`Array []`)
})
test('display can be used to display (escaped) strings', () => {
- return expectDisplayResult(`display("Tom's assisstant said: \\"tuna.\\"");`, { native: true })
- .toMatchInlineSnapshot(`
-Array [
- "\\"Tom's assisstant said: \\\\\\"tuna.\\\\\\"\\"",
-]
-`)
+ return expectDisplayResult(
+ `display("Tom's assisstant said: \\"tuna.\\"");`
+ ).toMatchInlineSnapshot(`Array []`)
})
test('raw_display can be used to display (unescaped) strings directly', () => {
- return expectDisplayResult(`raw_display("Tom's assisstant said: \\"tuna.\\"");`, { native: true })
- .toMatchInlineSnapshot(`
-Array [
- "Tom's assisstant said: \\"tuna.\\"",
-]
-`)
+ return expectDisplayResult(
+ `raw_display("Tom's assisstant said: \\"tuna.\\"");`
+ ).toMatchInlineSnapshot(`Array []`)
})
test('display can be used to display functions', () => {
- return expectDisplayResult(`display(x => x); display((x, y) => x + y);`).toMatchInlineSnapshot(`
-Array [
- "x => x",
- "(x, y) => x + y",
-]
-`)
+ return expectDisplayResult(`display(x => x); display((x, y) => x + y);`).toMatchInlineSnapshot(
+ `Array []`
+ )
})
test('display can be used to display lists', () => {
- return expectDisplayResult(`display(list(1, 2));`, { chapter: Chapter.SOURCE_2, native: true })
- .toMatchInlineSnapshot(`
-Array [
- "[1, [2, null]]",
-]
-`)
+ return expectDisplayResult(`display(list(1, 2));`, Chapter.SOURCE_2).toMatchInlineSnapshot(
+ `Array []`
+ )
})
test('display can be used to display arrays', () => {
return expectDisplayResult(`display([1, 2, [4, 5]]);`, {
- chapter: Chapter.SOURCE_3,
- native: true
- }).toMatchInlineSnapshot(`
-Array [
- "[1, 2, [4, 5]]",
-]
-`)
+ chapter: Chapter.SOURCE_3
+ }).toMatchInlineSnapshot(`Array []`)
})
test('display can be used to display objects', () => {
return expectDisplayResult(`display({a: 1, b: 2, c: {d: 3}});`, {
chapter: Chapter.LIBRARY_PARSER
- }).toMatchInlineSnapshot(`
-Array [
- "{\\"a\\": 1, \\"b\\": 2, \\"c\\": {\\"d\\": 3}}",
-]
-`)
+ }).toMatchInlineSnapshot(`Array []`)
})
test('display with no arguments throws an error', () => {
diff --git a/src/__tests__/environment.ts b/src/__tests__/environment.ts
index e6b8b7b7a..623f3379e 100644
--- a/src/__tests__/environment.ts
+++ b/src/__tests__/environment.ts
@@ -1,10 +1,11 @@
import { Program } from 'estree'
-import { evaluateProgram as evaluate } from '../interpreter/interpreter'
-import { mockContext } from '../mocks/context'
+import { mockContext } from '../utils/testing/mocks'
import { parse } from '../parser/parser'
import { Chapter } from '../types'
import { stripIndent } from '../utils/formatters'
+import { evaluate } from '../cse-machine/interpreter'
+import { DEFAULT_SOURCE_OPTIONS } from '../runner'
test('Function params and body identifiers are in different environment', () => {
const code = stripIndent`
@@ -18,7 +19,7 @@ test('Function params and body identifiers are in different environment', () =>
const context = mockContext(Chapter.SOURCE_4)
context.prelude = null // hide the unneeded prelude
const parsed = parse(code, context)
- const it = evaluate(parsed as any as Program, context)
+ const it = evaluate(parsed as any as Program, context, DEFAULT_SOURCE_OPTIONS)
const stepsToComment = 13 // manually counted magic number
for (let i = 0; i < stepsToComment; i += 1) {
it.next()
diff --git a/src/__tests__/environmentTree.ts b/src/__tests__/environmentTree.ts
index fa9e84a8a..7ef466d4f 100644
--- a/src/__tests__/environmentTree.ts
+++ b/src/__tests__/environmentTree.ts
@@ -1,6 +1,6 @@
import { createGlobalEnvironment, EnvTree, EnvTreeNode } from '../createContext'
-import { pushEnvironment } from '../interpreter/interpreter'
-import { mockContext, mockEnvironment } from '../mocks/context'
+import { pushEnvironment } from '../cse-machine/utils'
+import { mockContext, mockEnvironment } from '../utils/testing/mocks'
import { Chapter } from '../types'
test('EnvTree root should be null upon instantiation', () => {
diff --git a/src/__tests__/index.ts b/src/__tests__/index.ts
index bb6123e99..6003fce26 100644
--- a/src/__tests__/index.ts
+++ b/src/__tests__/index.ts
@@ -1,18 +1,16 @@
import { Position } from 'acorn/dist/acorn'
import { SourceLocation } from 'estree'
-import { findDeclaration, getScope } from '../index'
+import { findDeclaration, getScope, runInContext } from '../index'
import { Chapter, Value } from '../types'
import { stripIndent } from '../utils/formatters'
+import { createTestContext, expectParsedError, expectResult, testSuccess } from '../utils/testing'
+import { TestOptions } from '../utils/testing/types'
import {
- createTestContext,
- expectParsedError,
- expectParsedErrorNoErrorSnapshot,
- expectParsedErrorNoSnapshot,
- expectResult,
- expectToLooselyMatchJS,
- expectToMatchJS
-} from '../utils/testing'
+ evalWithBuiltins,
+ expectFinishedResultValue,
+ processTestOptions
+} from '../utils/testing/misc'
const toString = (x: Value) => '' + x
@@ -46,8 +44,7 @@ test('Arrow function definition returns itself', () => {
})
test('Builtins hide their implementation when stringify', () => {
- return expectResult('stringify(pair);', { chapter: Chapter.SOURCE_2, native: true })
- .toMatchInlineSnapshot(`
+ return expectResult('stringify(pair);', { chapter: Chapter.SOURCE_2 }).toMatchInlineSnapshot(`
"function pair(left, right) {
[implementation hidden]
}"
@@ -57,7 +54,6 @@ test('Builtins hide their implementation when stringify', () => {
test('Builtins hide their implementation when toString', () => {
return expectResult('toString(pair);', {
chapter: Chapter.SOURCE_2,
- native: true,
testBuiltins: { toString }
}).toMatchInlineSnapshot(`
"function pair(left, right) {
@@ -66,46 +62,18 @@ test('Builtins hide their implementation when toString', () => {
`)
})
-test('Objects toString matches up with JS', () => {
- return expectToMatchJS('toString({a: 1});', {
- chapter: Chapter.LIBRARY_PARSER,
- native: true,
- testBuiltins: { toString }
- })
-})
-
-test('Arrays toString matches up with JS', () => {
- return expectToMatchJS('toString([1, 2]);', {
- chapter: Chapter.SOURCE_3,
- native: true,
- testBuiltins: { toString }
- })
-})
-
-test('functions toString (mostly) matches up with JS', () => {
- return expectToLooselyMatchJS(
- stripIndent`
- function f(x) {
+test('functions toString (mostly) matches up with JS', async () => {
+ const code = stripIndent`
+ function f(x) {
return 5;
}
toString(a=>a) + toString(f);
- `,
- { native: true, testBuiltins: { toString } }
- )
-})
+ `
+ const options: TestOptions = { testBuiltins: { toString } }
+ const { result } = await testSuccess(code, options)
-test('primitives toString matches up with JS', () => {
- return expectToMatchJS(
- stripIndent`
- toString(true) +
- toString(false) +
- toString(1) +
- toString(1.5) +
- toString(null) +
- toString(undefined) +
- toString(NaN);
- `,
- { chapter: Chapter.SOURCE_2, native: true, testBuiltins: { toString } }
+ expect(result.value.replace(/ /g, '')).toEqual(
+ evalWithBuiltins(code, options.testBuiltins).replace(/ /g, '')
)
})
@@ -114,8 +82,7 @@ test('Factorial arrow function', () => {
stripIndent`
const fac = (i) => i === 1 ? 1 : i * fac(i-1);
fac(5);
- `,
- { native: true }
+ `
).toBe(120)
})
@@ -132,24 +99,15 @@ test('parseError for template literals with expressions', () => {
})
test('Simple arrow function infinite recursion represents CallExpression well', () => {
- return expectParsedErrorNoErrorSnapshot('(x => x(x)(x))(x => x(x)(x));').toMatchInlineSnapshot(`
- "Line 1: Maximum call stack size exceeded
- x(x => x(x)(x)).. x(x => x(x)(x)).. x(x => x(x)(x)).."
- `)
+ return expectParsedError('(x => x(x)(x))(x => x(x)(x));').toMatchInlineSnapshot(
+ `"Line 1: RangeError: Maximum call stack size exceeded"`
+ )
}, 30000)
test('Simple function infinite recursion represents CallExpression well', () => {
- return expectParsedErrorNoErrorSnapshot('function f(x) {return x(x)(x);} f(f);')
- .toMatchInlineSnapshot(`
- "Line 1: Maximum call stack size exceeded
- x(function f(x) {
- return x(x)(x);
- }).. x(function f(x) {
- return x(x)(x);
- }).. x(function f(x) {
- return x(x)(x);
- }).."
- `)
+ return expectParsedError('function f(x) {return x(x)(x);} f(f);').toMatchInlineSnapshot(
+ `"RangeError: Maximum call stack size exceeded"`
+ )
}, 30000)
test('Cannot overwrite consts even when assignment is allowed', () => {
@@ -162,7 +120,7 @@ test('Cannot overwrite consts even when assignment is allowed', () => {
}
test();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`"Line 3: Cannot assign new value to constant constant."`)
})
@@ -174,7 +132,7 @@ test('Assignment has value', () => {
b === 4 && a === 4;
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toBe(true)
})
@@ -186,7 +144,7 @@ test('Array assignment has value', () => {
const b = arr[1] = arr[2] = 4;
arr[0] === 1 && arr[1] === 4 && arr[2] === 4;
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toBe(true)
})
@@ -200,51 +158,46 @@ test('Can overwrite lets when assignment is allowed', () => {
}
test();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toBe(true)
})
test('Arrow function infinite recursion with list args represents CallExpression well', () => {
- return expectParsedErrorNoErrorSnapshot(
+ return expectParsedError(
stripIndent`
const f = xs => append(f(xs), list());
f(list(1, 2));
`,
{ chapter: Chapter.SOURCE_2 }
- ).toMatchInlineSnapshot(`
- "Line 1: Maximum call stack size exceeded
- f([1, [2, null]]).. f([1, [2, null]]).. f([1, [2, null]]).."
- `)
+ ).toMatchInlineSnapshot(
+ `"Line 2: The function (anonymous) has encountered an infinite loop. It has no base case."`
+ )
}, 30000)
test('Function infinite recursion with list args represents CallExpression well', () => {
- return expectParsedErrorNoErrorSnapshot(
+ return expectParsedError(
stripIndent`
function f(xs) { return append(f(xs), list()); }
f(list(1, 2));
- `,
- { chapter: Chapter.SOURCE_2 }
- ).toMatchInlineSnapshot(`
- "Line 1: Maximum call stack size exceeded
- f([1, [2, null]]).. f([1, [2, null]]).. f([1, [2, null]]).."
- `)
+ `
+ ).toMatchInlineSnapshot(`"Line 1: Name append not declared."`)
}, 30000)
test('Arrow function infinite recursion with different args represents CallExpression well', () => {
- return expectParsedErrorNoSnapshot(stripIndent`
+ return expectParsedError(stripIndent`
const f = i => f(i+1) - 1;
f(0);
- `).toEqual(
- expect.stringMatching(/^Line 1: Maximum call stack size exceeded\n\ *(f\(\d*\)[^f]{2,4}){3}/)
+ `).toMatchInlineSnapshot(
+ `"Line 2: The function (anonymous) has encountered an infinite loop. It has no base case."`
)
}, 30000)
test('Function infinite recursion with different args represents CallExpression well', () => {
- return expectParsedErrorNoSnapshot(stripIndent`
+ return expectParsedError(stripIndent`
function f(i) { return f(i+1) - 1; }
f(0);
- `).toEqual(
- expect.stringMatching(/^Line 1: Maximum call stack size exceeded\n\ *(f\(\d*\)[^f]{2,4}){3}/)
+ `).toMatchInlineSnapshot(
+ `"Line 2: The function f has encountered an infinite loop. It has no base case."`
)
}, 30000)
@@ -256,7 +209,7 @@ test('Functions passed into non-source functions remain equal', () => {
}
identity(t) === t && t(1, 2, 3) === 6;
`,
- { chapter: Chapter.SOURCE_3, testBuiltins: { 'identity(x)': (x: any) => x }, native: true }
+ { chapter: Chapter.SOURCE_3, testBuiltins: { 'identity(x)': (x: any) => x } }
).toBe(true)
})
@@ -266,7 +219,7 @@ test('Accessing array with nonexistent index returns undefined', () => {
const a = [];
a[1];
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toBe(undefined)
})
@@ -276,7 +229,7 @@ test('Accessing object with nonexistent property returns undefined', () => {
const o = {};
o.nonexistent;
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toBe(undefined)
})
@@ -287,7 +240,7 @@ test('Simple object assignment and retrieval', () => {
o.a = 1;
o.a;
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toBe(1)
})
@@ -300,7 +253,7 @@ test('Deep object assignment and retrieval', () => {
o.a.b.c = "string";
o.a.b.c;
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toBe('string')
})
@@ -309,7 +262,7 @@ test('Test apply_in_underlying_javascript', () => {
stripIndent`
apply_in_underlying_javascript((a, b, c) => a * b * c, list(2, 5, 6));
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toBe(60)
})
@@ -318,7 +271,7 @@ test('Test equal for primitives', () => {
stripIndent`
equal(1, 1) && equal("str", "str") && equal(null, null) && !equal(1, 2) && !equal("str", "");
`,
- { chapter: Chapter.SOURCE_2, native: true }
+ { chapter: Chapter.SOURCE_2 }
).toBe(true)
})
@@ -327,7 +280,7 @@ test('Test equal for lists', () => {
stripIndent`
equal(list(1, 2), pair(1, pair(2, null))) && equal(list(1, 2, 3, 4), list(1, 2, 3, 4));
`,
- { chapter: Chapter.SOURCE_2, native: true }
+ { chapter: Chapter.SOURCE_2 }
).toBe(true)
})
@@ -336,7 +289,7 @@ test('Test equal for different lists', () => {
stripIndent`
!equal(list(1, 2), pair(1, 2)) && !equal(list(1, 2, 3), list(1, list(2, 3)));
`,
- { chapter: Chapter.SOURCE_2, native: true }
+ { chapter: Chapter.SOURCE_2 }
).toBe(true)
})
@@ -346,8 +299,7 @@ test('true if with empty if works', () => {
if (true) {
} else {
}
- `,
- { native: true }
+ `
).toBe(undefined)
})
@@ -358,8 +310,7 @@ test('true if with nonempty if works', () => {
1;
} else {
}
- `,
- { native: true }
+ `
).toBe(1)
})
@@ -369,8 +320,7 @@ test('false if with empty else works', () => {
if (false) {
} else {
}
- `,
- { native: true }
+ `
).toBe(undefined)
})
@@ -381,57 +331,105 @@ test('false if with nonempty if works', () => {
} else {
2;
}
- `,
- { native: true }
+ `
).toBe(2)
})
-test('test true conditional expression', () => {
- return expectToMatchJS('true ? true : false;', { native: true })
-})
+describe('matchJSTests', () => {
+ async function expectToMatchJS(code: string, rawOptions: TestOptions = {}) {
+ const options = processTestOptions(rawOptions)
+ if (options.testBuiltins) {
+ options.testBuiltins = {
+ ...options.testBuiltins,
+ toString
+ }
+ } else {
+ options.testBuiltins = { toString }
+ }
-test('test false conditional expression', () => {
- return expectToMatchJS('false ? true : false;', { native: true })
-})
+ const { result } = await testSuccess(code, options)
-test('test false && true', () => {
- return expectToMatchJS('false && true;', { native: true })
-})
+ expect(evalWithBuiltins(code, options.testBuiltins)).toEqual(result.value)
+ }
-test('test false && false', () => {
- return expectToMatchJS('false && false;', { native: true })
-})
+ test('primitives toString matches up with JS', async () => {
+ const code = stripIndent`
+ toString(true) +
+ toString(false) +
+ toString(1) +
+ toString(1.5) +
+ toString(null) +
+ toString(undefined) +
+ toString(NaN);
+ `
+
+ const options: TestOptions = {
+ testBuiltins: { toString },
+ chapter: Chapter.SOURCE_2
+ }
+ const { result } = await testSuccess(code, options)
+ expect(evalWithBuiltins(code, options.testBuiltins)).toEqual(result.value)
+ })
-test('test true && false', () => {
- return expectToMatchJS('true && false;', { native: true })
-})
+ test('test true conditional expression', () => {
+ return expectToMatchJS('true ? true : false;')
+ })
-test('test true && true', () => {
- return expectToMatchJS('true && true;', { native: true })
-})
+ test('test false conditional expression', () => {
+ return expectToMatchJS('false ? true : false;')
+ })
-test('test && shortcircuiting', () => {
- return expectToMatchJS('false && 1();', { native: true })
-})
+ test('test false && true', () => {
+ return expectToMatchJS('false && true;')
+ })
-test('test false || true', () => {
- return expectToMatchJS('false || true;', { native: true })
-})
+ test('test false && false', () => {
+ return expectToMatchJS('false && false;')
+ })
-test('test false || false', () => {
- return expectToMatchJS('false || false;', { native: true })
-})
+ test('test true && false', () => {
+ return expectToMatchJS('true && false;')
+ })
-test('test true || false', () => {
- return expectToMatchJS('true || false;', { native: true })
-})
+ test('test true && true', () => {
+ return expectToMatchJS('true && true;')
+ })
-test('test true || true', () => {
- return expectToMatchJS('true || true;', { native: true })
-})
+ test('test && shortcircuiting', () => {
+ return expectToMatchJS('false && 1();')
+ })
+
+ test('test false || true', () => {
+ return expectToMatchJS('false || true;')
+ })
+
+ test('test false || false', () => {
+ return expectToMatchJS('false || false;')
+ })
+
+ test('test true || false', () => {
+ return expectToMatchJS('true || false;')
+ })
+
+ test('test true || true', () => {
+ return expectToMatchJS('true || true;')
+ })
+
+ test('test || shortcircuiting', () => {
+ return expectToMatchJS('true || 1();')
+ })
+
+ test('Objects toString matches up with JS', () => {
+ return expectToMatchJS('toString({a: 1});', {
+ chapter: Chapter.LIBRARY_PARSER
+ })
+ })
-test('test || shortcircuiting', () => {
- return expectToMatchJS('true || 1();', { native: true })
+ test('Arrays toString matches up with JS', () => {
+ return expectToMatchJS('toString([1, 2]);', {
+ chapter: Chapter.SOURCE_3
+ })
+ })
})
test('Rest parameters work', () => {
@@ -447,7 +445,7 @@ test('Rest parameters work', () => {
rest(1, 2); // no error
rest(1, 2, ...[3, 4, 5], ...[6, 7], ...[]);
`,
- { native: true, chapter: Chapter.SOURCE_3 }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`28`)
})
@@ -461,10 +459,18 @@ test('Test context reuse', async () => {
}
i;
`
- await expectResult(init, { context, native: true }).toBe(0)
- await expectResult('i = 100; f();', { context, native: true }).toBe(101)
- await expectResult('f(); i;', { context, native: true }).toBe(102)
- return expectResult('i;', { context, native: true }).toBe(102)
+
+ const snippets: [string, any][] = [
+ [init, 0],
+ ['i = 100; f();', 101],
+ ['f(); i;', 102],
+ ['i;', 102]
+ ]
+
+ for (const [code, expected] of snippets) {
+ const result = await runInContext(code, context)
+ expectFinishedResultValue(result, expected)
+ }
})
class SourceLocationTestResult {
diff --git a/src/__tests__/inspect.ts b/src/__tests__/inspect.ts
deleted file mode 100644
index 4a1eeffba..000000000
--- a/src/__tests__/inspect.ts
+++ /dev/null
@@ -1,483 +0,0 @@
-/* tslint:disable:max-line-length */
-import { parseError, resume, runInContext } from '../index'
-import { mockContext } from '../mocks/context'
-import { setBreakpointAtLine } from '../stdlib/inspector'
-import { Chapter, Environment, Result } from '../types'
-
-// we need to tame the environments for snapshotting,
-// so we remove the tail part that is a copy of the previous environment
-// and we remove the first global environment
-function flattenEnvironments(result: Result): Environment[] {
- return (result as any)
- .context!.runtime.environments.slice(0, -1)
- .map((env: Environment) => ({ ...env, tail: null }))
-}
-
-// Test suite skipped since functionality of debugger statements
-// has been changed for environment visualiser.
-xtest('debugger; statement basic test', () => {
- const code1 = `
- let a = 2;
- debugger;
- `
- const context = mockContext(Chapter.SOURCE_3)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('debugger; statement in function', () => {
- const code1 = `
- function a(x){
- debugger;
- return x;
- }
- a(10);
- `
- const context = mockContext(Chapter.SOURCE_3)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('debugger; statement execution sequence', () => {
- const code1 = `
- function a(x){
- return x;
- debugger;
- }
- a(10);
- `
- const context = mockContext(Chapter.SOURCE_3)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('finished')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('debugger; statement test function scope', () => {
- const code1 = `
- function a(x){
- let b = 10 * x;
- let c = 20 * x;
- let d = 30 * x;
- let e = d * b;
- let f = c * d;
- let g = 10 * c;
- let h = g + d;
- let i = g / 3;
- let j = f / b;
- let k = b / e;
- let l = b / c;
- debugger;
- return x;
- }
- a(10);
- `
- const context = mockContext(Chapter.SOURCE_3)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('debugger; statement hoisting', () => {
- const code1 = `
- function a(x){
- debugger;
- let z = 20;
- let c = z * x;
- let b = 123095;
- return x;
- }
- a(10);
- `
- const context = mockContext(Chapter.SOURCE_3)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('debugger; pauses for', () => {
- const code1 = `
- function a(x){
- for (let i=0; i {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('debugger; pauses while', () => {
- const code1 = `
- function a(x){
- while(x > 1){
- debugger;
- x=x-1;
- }
- }
- a(10);
- `
- const context = mockContext(Chapter.SOURCE_3)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-/* Breakpoints by line
- * The frontend editor sets breakpoints through this, results might differ
- * with debugger; statements. For all intents and purposes the correctness is:
- * - whatever your little heart desires!
- * - debugger;
- * - setBreakpointAtLine
- * So if anything goes wrong with this, default to your mental model or the
- * behavior of the debugger; statement.
- */
-
-xtest('setBreakpointAtLine basic', () => {
- const code1 = `
- const a = 10;
- const b = 20;
- `
- const context = mockContext(Chapter.SOURCE_3)
- setBreakpointAtLine(['helloworld'])
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('setBreakpointAtLine function 1', () => {
- const code1 = `
- function a(x){
- return x + x;
- }
- a(10);
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[1] = 'asd'
- setBreakpointAtLine(breakline)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('setBreakpointAtLine function 2', () => {
- const code1 = `
- function a(x){
- return x + x;
- }
- a("bob");
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[2] = 'asd'
- setBreakpointAtLine(breakline)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('setBreakpointAtLine function 3', () => {
- // this code will never break because the breakpoint is at a bracket which
- // will never be evaluated.
- const code1 = `
- function a(x){
- return x + x;
- }
- a(20);
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[3] = 'asd'
- setBreakpointAtLine(breakline)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('finished')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('setBreakpointAtLine function 4', () => {
- const code1 = `
- function a(x){
- return x + x;
- }
- a(123345898);
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[4] = 'asd'
- setBreakpointAtLine(breakline)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
-})
-
-xtest('setBreakpointAtLine granularity 1', () => {
- // this tests that we can indeed stop at individual lines
- const code1 = `
- function a(ctrlf){
- return ctrlf < 0 ?
- 0 :
- a(ctrlf - 1);
- }
- a(1);
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[2] = 'a'
- setBreakpointAtLine(breakline)
- // right now for some reason it breaks twice at the line.
- // this should not happen
- // if you do fix this issue, this is good to modify.
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj1) as Promise).then(obj2 => {
- return (resume(obj2) as Promise).then(obj3 => {
- expect(flattenEnvironments(obj3)).toMatchSnapshot()
- expect(obj3.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
- })
- })
-})
-
-xtest('setBreakpointAtLine granularity 2', () => {
- // this tests that we can indeed stop at individual lines
- const code1 = `
- function a(ctrlf){
- return ctrlf < 0 ?
- 0 :
- a(ctrlf - 1);
- }
- a(1);
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[3] = 'a'
- setBreakpointAtLine(breakline)
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj1) as Promise).then(obj2 => {
- expect(flattenEnvironments(obj2)).toMatchSnapshot()
- expect(obj2.status).toBe('finished')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
- })
-})
-
-xtest('setBreakpointAtLine granularity 3', () => {
- // this tests that we can indeed stop at individual lines
- const code1 = `
- function a(ctrlf){
- return ctrlf < 0 ?
- 0 :
- a(ctrlf - 1);
- }
- a(1);
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[4] = 'a'
- setBreakpointAtLine(breakline)
- // for some reason this is safe from the breaking twice problem
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj1) as Promise).then(obj2 => {
- expect(flattenEnvironments(obj2)).toMatchSnapshot()
- expect(obj2.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj2) as Promise).then(obj3 => {
- expect(flattenEnvironments(obj3)).toMatchSnapshot()
- expect(obj3.status).toBe('finished')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
- })
- })
-})
-
-xtest('setBreakpointAtLine for loops', () => {
- // test stuff in loops work fine
- const code1 = `
- for(let i=1;i<10;i=i*2) {
- const b = i;
- }
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[2] = '2'
- setBreakpointAtLine(breakline)
- // for some reason this is safe from the breaking twice problem
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj1) as Promise).then(obj2 => {
- expect(flattenEnvironments(obj2)).toMatchSnapshot()
- expect(obj2.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj2) as Promise).then(obj3 => {
- expect(flattenEnvironments(obj3)).toMatchSnapshot()
- expect(obj3.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj3) as Promise).then(obj4 => {
- expect(flattenEnvironments(obj4)).toMatchSnapshot()
- expect(obj4.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj4) as Promise).then(obj5 => {
- expect(flattenEnvironments(obj5)).toMatchSnapshot()
- expect(obj5.status).toBe('finished')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
- })
- })
- })
- })
-})
-
-xtest('setBreakpointAtLine while loops', () => {
- // test stuff in loops work fine
- const code1 = `
- let a = 9;
- while (a > 3){
- a = a - 3;
- }
- `
- const context = mockContext(Chapter.SOURCE_3)
- const breakline = []
- breakline[3] = '3'
- setBreakpointAtLine(breakline)
- // for some reason this is safe from the breaking twice problem
- return runInContext(code1, context, {
- scheduler: 'preemptive',
- executionMethod: 'auto'
- }).then(obj1 => {
- flattenEnvironments(obj1).forEach(environment => {
- expect(environment).toMatchSnapshot()
- })
- expect(obj1.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj1) as Promise).then(obj2 => {
- expect(flattenEnvironments(obj2)).toMatchSnapshot()
- expect(obj2.status).toBe('suspended-cse-eval')
- expect(parseError(context.errors)).toMatchSnapshot()
- return (resume(obj2) as Promise).then(obj5 => {
- expect(flattenEnvironments(obj5)).toMatchSnapshot()
- expect(obj5.status).toBe('finished')
- expect(parseError(context.errors)).toMatchSnapshot()
- })
- })
- })
-})
diff --git a/src/__tests__/return-regressions.ts b/src/__tests__/return-regressions.ts
index f690e5e74..587f7120d 100644
--- a/src/__tests__/return-regressions.ts
+++ b/src/__tests__/return-regressions.ts
@@ -36,8 +36,7 @@ test('Bare early returns work', () => {
unreachable();
}
f();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`1`)
})
@@ -58,8 +57,7 @@ test('Recursive call early returns work', () => {
unreachable();
}
f();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`3`)
})
@@ -80,8 +78,7 @@ test('Tail call early returns work', () => {
unreachable();
}
f();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`1`)
})
@@ -102,8 +99,7 @@ test('Bare early returns in if statements work', () => {
unreachable();
}
f();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`1`)
})
@@ -127,8 +123,7 @@ test('Recursive call early returns in if statements work', () => {
unreachable();
}
f();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`3`)
})
@@ -152,8 +147,7 @@ test('Tail call early returns in if statements work', () => {
unreachable();
}
f();
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`1`)
})
@@ -175,7 +169,7 @@ test('Bare early returns in while loops work', () => {
}
f();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ Chapter.SOURCE_3
).toMatchInlineSnapshot(`1`)
})
@@ -200,7 +194,7 @@ test('Recursive call early returns in while loops work', () => {
}
f();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ Chapter.SOURCE_3
).toMatchInlineSnapshot(`3`)
})
@@ -225,7 +219,7 @@ test('Tail call early returns in while loops work', () => {
}
f();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`1`)
})
@@ -247,7 +241,7 @@ test('Bare early returns in for loops work', () => {
}
f();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`1`)
})
@@ -269,7 +263,7 @@ test('Recursive call early returns in for loops work', () => {
}
f();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`3`)
})
@@ -294,6 +288,6 @@ test('Tail call early returns in for loops work', () => {
}
f();
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`1`)
})
diff --git a/src/__tests__/stdlib.ts b/src/__tests__/stdlib.ts
index 9e77f2816..421a4bf25 100644
--- a/src/__tests__/stdlib.ts
+++ b/src/__tests__/stdlib.ts
@@ -615,11 +615,10 @@ test.each([
(chapter: Chapter, snippet: string, passing: boolean, returnValue: Value) => {
if (passing) {
return expectResult(stripIndent(snippet), {
- chapter,
- native: chapter !== Chapter.LIBRARY_PARSER
+ chapter
}).toEqual(returnValue)
} else {
- return snapshotFailure(stripIndent(snippet), { chapter }, 'fails')
+ return snapshotFailure(stripIndent(snippet), { chapter })
}
}
)
diff --git a/src/__tests__/stringify-benchmark.ts b/src/__tests__/stringify-benchmark.ts
index 485382f3e..113aefba2 100644
--- a/src/__tests__/stringify-benchmark.ts
+++ b/src/__tests__/stringify-benchmark.ts
@@ -31,7 +31,7 @@ test('stringify is fast', () => {
const end = get_time();
end - start;
`,
- { chapter: Chapter.SOURCE_3, native: false }
+ { chapter: Chapter.SOURCE_3 }
).then(testResult => testResult.result)
).resolves.toBeLessThan(2000)
// This benchmark takes 100ms on my machine,
@@ -140,7 +140,6 @@ test('display_list with stringify is linear runtime', () => {
`,
{
chapter: Chapter.SOURCE_3,
- native: false, // we're measuring a builtin, no need for native
testBuiltins: {
no_display_list: noDisplayList
}
diff --git a/src/__tests__/stringify.ts b/src/__tests__/stringify.ts
index 27b846b8b..29e6d8e26 100644
--- a/src/__tests__/stringify.ts
+++ b/src/__tests__/stringify.ts
@@ -12,8 +12,7 @@ test('String representation of numbers are nice', () => {
return expectResult(
stripIndent`
stringify(0);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`"0"`)
})
@@ -21,8 +20,7 @@ test('String representation of strings are nice', () => {
return expectResult(
stripIndent`
stringify('a string');
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`"\\"a string\\""`)
})
@@ -30,8 +28,7 @@ test('String representation of booleans are nice', () => {
return expectResult(
stripIndent`
stringify('true');
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`"\\"true\\""`)
})
@@ -42,8 +39,7 @@ test('String representation of functions are nice', () => {
return x;
}
stringify(f);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`
"function f(x, y) {
return x;
@@ -56,8 +52,7 @@ test('String representation of arrow functions are nice', () => {
stripIndent`
const f = (x, y) => x;
stringify(f);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`"(x, y) => x"`)
})
@@ -67,7 +62,7 @@ test('String representation of arrays are nice', () => {
const xs = [1, 'true', true, () => 1];
stringify(xs);
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`"[1, \\"true\\", true, () => 1]"`)
})
@@ -77,7 +72,7 @@ test('String representation of multidimensional arrays are nice', () => {
const xs = [1, 'true', [true, () => 1, [[]]]];
stringify(xs);
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`"[1, \\"true\\", [true, () => 1, [[]]]]"`)
})
@@ -87,7 +82,7 @@ test('String representation of empty arrays are nice', () => {
const xs = [];
stringify(xs);
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`"[]"`)
})
@@ -96,7 +91,7 @@ test('String representation of lists are nice', () => {
stripIndent`
stringify(enum_list(1, 10));
`,
- { chapter: Chapter.SOURCE_2, native: true }
+ { chapter: Chapter.SOURCE_2 }
).toMatchInlineSnapshot(`"[1, [2, [3, [4, [5, [6, [7, [8, [9, [10, null]]]]]]]]]]"`)
})
@@ -107,7 +102,7 @@ test('Correctly handles circular structures with multiple entry points', () => {
set_tail(tail(tail(x)), x);
stringify(list(x, tail(x), tail(tail(x))));
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`
"[ [1, [2, [3, ...]]],
[[2, [3, [1, ...]]], [[3, [1, [2, ...]]], null]]]"
@@ -121,7 +116,7 @@ test('String representation of huge lists are nice', () => {
stripIndent`
stringify(enum_list(1, 100));
`,
- { chapter: Chapter.SOURCE_2, native: true }
+ { chapter: Chapter.SOURCE_2 }
).toMatchInlineSnapshot(`
"[ 1,
[ 2,
@@ -225,7 +220,7 @@ test('String representation of huge arrays are nice', () => {
}
stringify(arr);
`,
- { chapter: Chapter.SOURCE_3, native: true }
+ { chapter: Chapter.SOURCE_3 }
).toMatchInlineSnapshot(`
"[ 0,
1,
@@ -336,7 +331,7 @@ test('String representation of objects are nice', () => {
const o = { a: 1, b: true, c: () => 1 };
stringify(o);
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toMatchInlineSnapshot(`"{\\"a\\": 1, \\"b\\": true, \\"c\\": () => 1}"`)
})
@@ -346,7 +341,7 @@ test('String representation of objects with toReplString member calls toReplStri
const o = { toReplString: () => '' };
stringify(o);
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toMatchInlineSnapshot(`""`)
})
@@ -356,7 +351,7 @@ test('String representation of nested objects are nice', () => {
const o = { a: 1, b: true, c: () => 1, d: { e: 5, f: 6 } };
stringify(o);
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toMatchInlineSnapshot(
`"{\\"a\\": 1, \\"b\\": true, \\"c\\": () => 1, \\"d\\": {\\"e\\": 5, \\"f\\": 6}}"`
)
@@ -368,7 +363,7 @@ test('String representation of big objects are nice', () => {
const o = { a: 1, b: true, c: () => 1, d: { e: 5, f: 6 }, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0, m: 0, n: 0};
stringify(o);
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toMatchInlineSnapshot(`
"{ \\"a\\": 1,
\\"b\\": true,
@@ -392,7 +387,7 @@ test('String representation of nested objects are nice', () => {
o.o = o;
stringify(o);
`,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
+ { chapter: Chapter.LIBRARY_PARSER }
).toMatchInlineSnapshot(`"{\\"o\\": ...}"`)
})
@@ -432,7 +427,7 @@ test('String representation of builtins are nice', () => {
stripIndent`
stringify(pair);
`,
- { chapter: Chapter.SOURCE_2, native: true }
+ { chapter: Chapter.SOURCE_2 }
).toMatchInlineSnapshot(`
"function pair(left, right) {
[implementation hidden]
@@ -445,7 +440,7 @@ test('String representation of null is nice', () => {
stripIndent`
stringify(null);
`,
- { chapter: Chapter.SOURCE_2, native: true }
+ { chapter: Chapter.SOURCE_2 }
).toMatchInlineSnapshot(`"null"`)
})
@@ -453,8 +448,7 @@ test('String representation of undefined is nice', () => {
return expectResult(
stripIndent`
stringify(undefined);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`"undefined"`)
})
@@ -464,7 +458,7 @@ test('String representation with no indent', () => {
stripIndent`
stringify(parse('x=>x;'), 0);
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toMatchInlineSnapshot(`
"[\\"lambda_expression\\",
[[[\\"name\\", [\\"x\\", null]], null],
@@ -477,7 +471,7 @@ test('String representation with 1 space indent', () => {
stripIndent`
stringify(parse('x=>x;'), 1);
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toMatchInlineSnapshot(`
"[\\"lambda_expression\\",
[[[\\"name\\", [\\"x\\", null]], null],
@@ -490,7 +484,7 @@ test('String representation with default (2 space) indent', () => {
stripIndent`
stringify(parse('x=>x;'));
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toMatchInlineSnapshot(`
"[ \\"lambda_expression\\",
[ [[\\"name\\", [\\"x\\", null]], null],
@@ -503,7 +497,7 @@ test('String representation with more than 10 space indent should trim to 10 spa
stripIndent`
stringify(parse('x=>x;'), 100);
`,
- { chapter: Chapter.SOURCE_4, native: true }
+ { chapter: Chapter.SOURCE_4 }
).toMatchInlineSnapshot(`
"[ \\"lambda_expression\\",
[ [[\\"name\\", [\\"x\\", null]], null],
diff --git a/src/__tests__/tailcall-return.ts b/src/__tests__/tailcall-return.ts
index 9a3a0ce27..7133595a8 100644
--- a/src/__tests__/tailcall-return.ts
+++ b/src/__tests__/tailcall-return.ts
@@ -1,8 +1,8 @@
import { stripIndent } from '../utils/formatters'
-import { expectParsedErrorNoSnapshot, expectResult } from '../utils/testing'
+import { expectParsedError, expectResult } from '../utils/testing'
test('Check that stack is at most 10k in size', () => {
- return expectParsedErrorNoSnapshot(stripIndent`
+ return expectParsedError(stripIndent`
function f(x) {
if (x <= 0) {
return 0;
@@ -11,7 +11,7 @@ test('Check that stack is at most 10k in size', () => {
}
}
f(10000);
- `).toEqual(expect.stringMatching(/Maximum call stack size exceeded\n([^f]*f){3}/))
+ `).toMatchInlineSnapshot(`"Line 5: RangeError: Maximum call stack size exceeded"`)
}, 10000)
test('Simple tail call returns work', () => {
@@ -25,8 +25,7 @@ test('Simple tail call returns work', () => {
}
}
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -37,8 +36,7 @@ test('Tail call in conditional expressions work', () => {
return x <= 0 ? y : f(x-1, y+1);
}
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -53,8 +51,7 @@ test('Tail call in boolean operators work', () => {
}
}
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -65,8 +62,7 @@ test('Tail call in nested mix of conditional expressions boolean operators work'
return x <= 0 ? y : false || x > 0 ? f(x-1, y+1) : 'unreachable';
}
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -75,8 +71,7 @@ test('Tail calls in arrow functions work', () => {
stripIndent`
const f = (x, y) => x <= 0 ? y : f(x-1, y+1);
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -91,8 +86,7 @@ test('Tail calls in arrow block functions work', () => {
}
};
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -114,8 +108,7 @@ test('Tail calls in mutual recursion work', () => {
}
}
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -125,8 +118,7 @@ test('Tail calls in mutual recursion with arrow functions work', () => {
const f = (x, y) => x <= 0 ? y : g(x-1, y+1);
const g = (x, y) => x <= 0 ? y : f(x-1, y+1);
f(5000, 5000);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`10000`)
})
@@ -141,7 +133,6 @@ test('Tail calls in mixed tail-call/non-tail-call recursion work', () => {
}
}
f(5000, 5000, 2);
- `,
- { native: true }
+ `
).toMatchInlineSnapshot(`15000`)
})
diff --git a/src/alt-langs/__tests__/mapper.ts b/src/alt-langs/__tests__/mapper.ts
index 8c4b8374b..6aaa97ea9 100644
--- a/src/alt-langs/__tests__/mapper.ts
+++ b/src/alt-langs/__tests__/mapper.ts
@@ -1,4 +1,4 @@
-import { mockContext } from "../../mocks/context";
+import { mockContext } from "../../utils/testing/mocks";
import { Chapter, Finished } from "../../types";
import { mapResult } from "../mapper";
diff --git a/src/alt-langs/scheme/__tests__/scheme-parser.ts b/src/alt-langs/scheme/__tests__/scheme-parser.ts
index 89da8bbe5..a787f1ef7 100644
--- a/src/alt-langs/scheme/__tests__/scheme-parser.ts
+++ b/src/alt-langs/scheme/__tests__/scheme-parser.ts
@@ -1,5 +1,5 @@
import { parseError } from '../../..'
-import { mockContext } from '../../../mocks/context'
+import { mockContext } from '../../../utils/testing/mocks'
import { Chapter } from '../../../types'
import { SchemeParser } from '../../../parser/scheme'
diff --git a/src/constants.ts b/src/constants.ts
index 6b04dd92a..00d6e3ed5 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -35,7 +35,6 @@ export const sourceLanguages: Language[] = [
{ chapter: Chapter.SOURCE_2, variant: Variant.TYPED },
{ chapter: Chapter.SOURCE_3, variant: Variant.DEFAULT },
{ chapter: Chapter.SOURCE_3, variant: Variant.TYPED },
- { chapter: Chapter.SOURCE_3, variant: Variant.CONCURRENT },
{ chapter: Chapter.SOURCE_4, variant: Variant.DEFAULT },
{ chapter: Chapter.SOURCE_4, variant: Variant.TYPED },
{ chapter: Chapter.SOURCE_4, variant: Variant.EXPLICIT_CONTROL }
diff --git a/src/createContext.ts b/src/createContext.ts
index 705b70dcb..ac4a8ece0 100644
--- a/src/createContext.ts
+++ b/src/createContext.ts
@@ -11,7 +11,6 @@ import {
import { GLOBAL, JSSLANG_PROPERTIES } from './constants'
import { call_with_current_continuation } from './cse-machine/continuations'
import Heap from './cse-machine/heap'
-import { AsyncScheduler } from './schedulers'
import * as list from './stdlib/list'
import { list_to_vector } from './stdlib/list'
import { listPrelude } from './stdlib/list.prelude'
@@ -120,8 +119,7 @@ const createEmptyDebugger = () => ({
state: {
it: (function* (): any {
return
- })(),
- scheduler: new AsyncScheduler()
+ })()
}
})
diff --git a/src/cse-machine/__tests__/__snapshots__/cse-machine-callcc-js.ts.snap b/src/cse-machine/__tests__/__snapshots__/cse-machine-callcc-js.ts.snap
deleted file mode 100644
index 459de6d64..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cse-machine-callcc-js.ts.snap
+++ /dev/null
@@ -1,77 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`call_cc can be used to return early: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let x = 1;
-call_cc((cont) => {
- x = 2;
- cont();
- x = 3;
-});
-x;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`call_cc throws error when given > 1 arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (cont) => cont;
-1 + 2 + call_cc(f,f) + 4;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`call_cc throws error when given no arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "1 + 2 + call_cc() + 4;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 1 arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`call_cc works with normal functions: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "1 + 2 + call_cc((cont) => 3) + 4;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`continuations can be stored as a value: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let a = 0;
-call_cc((cont) => {
- a = cont;
-});
-a;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": [Function],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cse-machine-callcc.ts.snap b/src/cse-machine/__tests__/__snapshots__/cse-machine-callcc.ts.snap
deleted file mode 100644
index df1220603..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cse-machine-callcc.ts.snap
+++ /dev/null
@@ -1,100 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`basic call/cc works: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (+ 1 2 (call/cc
- (lambda (k) (k 3)))
- 4)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 10n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`call/cc can be stored as a value: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- ;; storing a continuation
- (define a #f)
-
- (+ 1 2 3 (call/cc (lambda (k) (set! a k) 0)) 4 5)
-
- ;; continuations are treated as functions
- ;; so we can do this:
- (procedure? a)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`call/cc can be used to escape a computation: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define test 1)
- (call/cc (lambda (k)
- (set! test 2)
- (k 'escaped)
- (set! test 3)))
- ;; test should be 2
- test
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 2n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`call/cc throws error given >1 argument: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (+ 1 2 (call/cc
- (lambda (k) (k 3))
- 'wrongwrongwrong!)
- 4)
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`call/cc throws error given no arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (+ 1 2 (call/cc) 4)
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cse-machine-errors.ts.snap b/src/cse-machine/__tests__/__snapshots__/cse-machine-errors.ts.snap
deleted file mode 100644
index 5d412190e..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cse-machine-errors.ts.snap
+++ /dev/null
@@ -1,1049 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Builtins don't create additional errors when it's not their fault: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return a;
-}
-map(f, list(1, 2));",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Name a not declared.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Cannot overwrite loop variables within a block: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let z = [];
- for (let x = 0; x < 2; x = x + 1) {
- x = 1;
- }
- return false;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Assignment to a for loop variable in the for loop is not allowed.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Cascading js errors work properly: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function h(p) {
- return head(p);
-}
-
-h(null);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Error: head(xs) expects a pair as argument xs, but encountered null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when accessing temporal dead zone: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const a = 1;
-function f() {
- display(a);
- const a = 5;
-}
-f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Name a declared later in current scope but not yet assigned",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-map = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Cannot assign new value to constant map.
-As map was declared as a constant, its value cannot be changed. You will have to declare a new variable.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin - verbose: expectParsedError 2`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-undefined = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Cannot assign new value to constant undefined.
-As undefined was declared as a constant, its value cannot be changed. You will have to declare a new variable.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "map = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Cannot assign new value to constant map.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin: expectParsedError 2`] = `
-Object {
- "alertResult": Array [],
- "code": "undefined = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Cannot assign new value to constant undefined.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function in tail call with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-const g = () => 1;
-const f = x => g(x);
-f(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 15: Expected 0 arguments, but got 1.
-Try calling function g again, but with 0 arguments instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function in tail call with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const g = () => 1;
-const f = x => g(x);
-f(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 0 arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too few arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- const f = x => x;
- f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 2: Expected 1 arguments, but got 0.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too few arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- const f = x => x;
- f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 2: Expected 1 arguments, but got 2.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling builtin function in with too few arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int(\\"\\");",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 2 arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling builtin function in with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 1 arguments, but got 3.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function from member expression with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- const f = [x => x];
- f[0](1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 2: Expected 1 arguments, but got 2.
-Try calling function f[0] again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function from member expression with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = [x => x];
-f[0](1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too few arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- function f(x) {
- return x;
- }
- f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 5, Column 2: Expected 1 arguments, but got 0.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too few arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return x;
-}
-f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Expected 1 arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- function f(x) {
- return x;
- }
- f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 5, Column 2: Expected 1 arguments, but got 2.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return x;
-}
-f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value "string" - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- 'string'();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value \\"string\\".
-Because \\"string\\" is not a function, you cannot run \\"string\\"().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value "string": expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "'string'();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value \\"string\\".",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value 0 - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- 0();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value 0.
-Because 0 is not a function, you cannot run 0(). If you were planning to perform multiplication by 0, you need to use the * operator.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value 0: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "0();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value array - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-[1]();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Calling non-function value [1].
-Because [1] is not a function, you cannot run [1]().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value array: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "[1]();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value [1].",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value null - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- null();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: null literals are not allowed.
-They're not part of the Source §1 specs.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value null: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "null();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: null literals are not allowed.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value true - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- true();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value true.
-Because true is not a function, you cannot run true().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value true: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value true.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- undefined();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value undefined.
-Because undefined is not a function, you cannot run undefined().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined with arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- undefined(1, true);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value undefined.
-Because undefined is not a function, you cannot run undefined(1, true).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined with arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "undefined(1, true);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value undefined.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "undefined();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value undefined.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring const after function --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-function f() {}
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 6: SyntaxError: Identifier 'f' has already been declared (3:6)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring const after function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {}
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring constant as variable: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring constant: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after const --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-const f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after const: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after function --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-function f() {}
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {}
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after let --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-let f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after let: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring let after function --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-function f() {}
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 4: SyntaxError: Identifier 'f' has already been declared (3:4)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring let after function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {}
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring variable as constant: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let f = x => x;
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring variable: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let f = x => x;
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error with too few arguments passed to rest parameters: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function rest(a, b, ...c) {}
-rest(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 2 or more arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error with too many arguments passed to math_sin: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "math_sin(7,8);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`In a block, every going-to-be-defined variable in the block cannot be accessed until it has been defined in the block.: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const a = 1;
-{
- a + a;
- const a = 10;
-}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Name a declared later in current scope but not yet assigned",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Nice errors when errors occur inside builtins: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int(\\"10\\");",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 2 arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Nice errors when errors occur inside builtins: expectParsedError 2`] = `
-Object {
- "alertResult": Array [],
- "code": "parse(\\"'\\");",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: ParseError: SyntaxError: Unterminated string constant (1:0)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling display function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(1);
-display(1, \\"test\\");",
- "displayResult": Array [
- "1",
- "test 1",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling list function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "list();
-list(1);
-list(1, 2, 3);
-list(1, 2, 3, 4, 5, 6, 6);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- Array [
- 2,
- Array [
- 3,
- Array [
- 4,
- Array [
- 5,
- Array [
- 6,
- Array [
- 6,
- null,
- ],
- ],
- ],
- ],
- ],
- ],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling math_max function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "math_max();
-math_max(1, 2);
-math_max(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling math_min function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "math_min();
-math_min(1, 2);
-math_min(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling stringify function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(1, 2);
-stringify(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "1",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No hoisting of functions. Only the name is hoisted like let and const: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const v = f();
-function f() {
- return 1;
-}
-v;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Name f declared later in current scope but not yet assigned",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Shadowed variables may not be assigned to until declared in the current scope: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let variable = 1;
-function test(){
- variable = 100;
- let variable = true;
- return variable;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Name variable not declared.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error with * , error line at , not : expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "12
-*
-'string';",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected number on right hand side of operation, got string.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error with non boolean in if statement, error line at if statement, not at 1: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "if (
-1
-) {
- 2;
-} else {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected boolean as condition, got number.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Undefined variable error is thrown - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-im_undefined;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Name im_undefined not declared.
-Before you can read the value of im_undefined, you need to declare it as a variable or a constant. You can do this using the let or const keywords.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Undefined variable error is thrown: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "im_undefined;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Name im_undefined not declared.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Undefined variables are caught even when unreached: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const a = 1;
-if (false) {
- im_undefined;
-} else {
- a;
-}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Name im_undefined not declared.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cse-machine-return-regressions.ts.snap b/src/cse-machine/__tests__/__snapshots__/cse-machine-return-regressions.ts.snap
deleted file mode 100644
index 4a6940382..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cse-machine-return-regressions.ts.snap
+++ /dev/null
@@ -1,359 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Bare early returns in for loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- for (let i = 0; i < 100; i = i + 1) {
- return i+1;
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Bare early returns in if statements work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- if (true) {
- return 1;
- unreachable();
- } else {}
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Bare early returns in while loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- while (true) {
- return 1;
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Bare early returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- return 1;
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Calling unreachable results in error: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function f() {
- unreachable();
- return 0;
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3: Expected number on right hand side of operation, got boolean.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns in for loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- for (let i = 0; i < 100; i = i + 1) {
- return id(i+1) + id(i+2);
- }
- return 0;
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns in if statements work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- if (true) {
- return id(1) + id(2);
- unreachable();
- } else {}
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns in while loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- while (true) {
- return id(1) + id(2);
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Recursive call early returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- return id(1) + id(2);
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns in for loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- for (let i = 0; i < 100; i = i + 1) {
- return id(i+1);
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns in if statements work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- if (true) {
- return id(1);
- unreachable();
- } else {}
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns in while loops work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- while (true) {
- return id(1);
- unreachable();
- }
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call early returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- function unreachable() {
- return 1 < true; // Will cause an error
- }
- function id(x) {
- return x;
- }
- function f() {
- return id(1);
- unreachable();
- return 0;
- unreachable();
- }
- f();
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cse-machine-stdlib.ts.snap b/src/cse-machine/__tests__/__snapshots__/cse-machine-stdlib.ts.snap
index ef86d0b26..7db840268 100644
--- a/src/cse-machine/__tests__/__snapshots__/cse-machine-stdlib.ts.snap
+++ b/src/cse-machine/__tests__/__snapshots__/cse-machine-stdlib.ts.snap
@@ -1,621 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Builtins work as expected 0: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display('message');",
- "displayResult": Array [
- "\\"message\\"",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "message",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 1 1`] = `"Line 1: Error: \\"error!\\""`;
-exports[`Builtins work as expected 1: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "error('error!');",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: \\"error!\\"",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 40 1`] = `"Line 1: Error: head(xs) expects a pair as argument xs, but encountered null"`;
-exports[`Builtins work as expected 2: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_undefined(undefined);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 41 1`] = `"Line 1: Error: tail(xs) expects a pair as argument xs, but encountered null"`;
-exports[`Builtins work as expected 3: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_undefined(null);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 42 1`] = `"Line 1: Error: head(xs) expects a pair as argument xs, but encountered 1"`;
-exports[`Builtins work as expected 4: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_null(undefined);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 43 1`] = `"Line 1: Error: tail(xs) expects a pair as argument xs, but encountered 1"`;
-exports[`Builtins work as expected 5: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_null(null);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 6: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string('string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 7: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string('true');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 8: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string('1');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 9: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string(true);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 10: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_string(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 11: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number('string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 12: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number('true');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 13: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number('1');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 14: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(true);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 15: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 16: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean('string');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 17: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean('true');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 18: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean('1');",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 19: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean(true);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 20: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_boolean(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 21: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_function(display);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 22: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_function(x => x);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 23: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return x;
-}
-is_function(f);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 24: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_function(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 25: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_array(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 26: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_array(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 27: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_array([1]);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 28: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "array_length([1]);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 29: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int('10', 10);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 30: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int('10', 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 31: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(get_time());",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 32: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const start = get_time();
-function repeatUntilDifferentTime() {
- if (start === get_time()) {
- return repeatUntilDifferentTime();
- } else {
- return true;
- }
-}
-repeatUntilDifferentTime();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 33: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "pair(1, 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- 2,
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 34: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "list(1, 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- Array [
- 2,
- null,
- ],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 35: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_list(1);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 36: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_list(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 37: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_list(list(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 38: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "head(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 39: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "tail(pair(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 40: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "head(null);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: head(xs) expects a pair as argument xs, but encountered null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 41: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "tail(null);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: tail(xs) expects a pair as argument xs, but encountered null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 42: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "head(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: head(xs) expects a pair as argument xs, but encountered 1",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 43: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "tail(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Error: tail(xs) expects a pair as argument xs, but encountered 1",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 44: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "length(list(1, 2));",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins work as expected 45: fails 1`] = `
-Object {
- "alertResult": Array [],
- "code": "length(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 33: Error: tail(xs) expects a pair as argument xs, but encountered 1",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
+exports[`Builtins work as expected 45 1`] = `"Line 33: Error: tail(xs) expects a pair as argument xs, but encountered 1"`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cse-machine.ts.snap b/src/cse-machine/__tests__/__snapshots__/cse-machine.ts.snap
deleted file mode 100644
index 68b85f4c7..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cse-machine.ts.snap
+++ /dev/null
@@ -1,568 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Array literals are unpacked in the correct order: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let d = 0;
-let c = [ d = d * 10 + 1, d = d * 10 + 2, d = d * 10 + 3];
-d;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 123,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Array literals work as expected: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let c = [1, 2, 3];
-c;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- 2,
- 3,
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Breaks, continues and returns are detected properly inside loops: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {
- let i = 0;
- while(i < 10) {
- i = i + 1;
- if (i === 1) {
- i = 1;
- i = 1;
- } else if (i === 2) {
- i = 2;
- continue;
- } else if (i === 3) {
- i = 3;
- return i;
- } else if (i === 4) {
- i = 4;
- break;
- }
- }
- return i;
-}
-f();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Conditional statements are value producing always: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function fact(n) {
- if (n === 0) {
- 2;
- return 1;
- }
- if (true) {
- let i = 1;
- i = i - 1;
- } else {
- 2;
- }
- if (false) {
- 2;
- } else {
- const i = 1;
- }
- return n * fact(n - 1);
- }
-fact(5);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 120,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Environment reset is inserted when only instructions are in control stack: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const a = (v => v)(0);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Nullary functions properly restore environment 1: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {
- function g(t) {
- return 0;
- }
- return g;
-}
-const h = f();
-h(100);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 0,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Nullary functions properly restore environment 2: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {
- const a = 1;
- return a;
-}
-const a = f();
-a;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Simple tail call returns work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+1);
- }
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call in boolean operators work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return false || f(x-1, y+1);
- }
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call in conditional expressions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- return x <= 0 ? y : f(x-1, y+1);
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail call in nested mix of conditional expressions boolean operators work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- return x <= 0 ? y : false || x > 0 ? f(x-1, y+1) : 'unreachable';
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in arrow block functions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (x, y) => {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+1);
- }
-};
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in arrow functions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (x, y) => x <= 0 ? y : f(x-1, y+1);
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in mixed tail-call/non-tail-call recursion work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y, z) {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+f(0, z, 0), z);
- }
-}
-f(5000, 5000, 2);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 15000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in mutual recursion with arrow functions work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = (x, y) => x <= 0 ? y : g(x-1, y+1);
-const g = (x, y) => x <= 0 ? y : f(x-1, y+1);
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Tail calls in mutual recursion work: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return g(x-1, y+1);
- }
-}
-function g(x, y) {
- if (x <= 0) {
- return y;
- } else {
- return f(x-1, y+1);
- }
-}
-f(5000, 5000);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 10000,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`breaks, continues are properly detected in child blocks 1: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let i = 0;
-for (i = 1; i < 5; i = i + 1) {
- {
- const a = i;
- if (i === 1) {
- continue;
- }
- }
-
- {
- const a = i;
- if (i === 2) {
- break;
- }
- }
-}
-i;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`breaks, continues are properly detected in child blocks 2: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let a = 0;
-for (let i = 1; i < 5; i = i + 1) {
- {
- const x = 0;
- a = i;
- if (i === 1) {
- continue;
- }
- }
-
- {
- const x = 0;
- a = i;
- if (i === 2) {
- break;
- }
- }
-}
-a;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 2,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`const uses block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- const x = true;
- if(true) {
- const x = false;
- } else {
- const x = false;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`continue in while loops are working as intended: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let i = 0;
- let j = false;
- while (i <= 10){
- if (i === 10){
- j = true;
- i = i + 1;
- continue;
- }
- j = false;
- i = i + 1;
- }
- return j;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`for loop \`let\` variables are copied into the block scope: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let z = [];
- for (let x = 0; x < 10; x = x + 1) {
- z[x] = () => x;
- }
- return z[1]();
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`for loops use block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let x = true;
- for (let x = 1; x > 0; x = x - 1) {
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`let uses block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let x = true;
- if(true) {
- let x = false;
- } else {
- let x = false;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`standalone block statements: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- const x = true;
- {
- const x = false;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`streams and its pre-defined/pre-built functions are working as intended: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function make_alternating_stream(stream) {
- return pair(head(stream), () => make_alternating_stream(
- negate_whole_stream(
- stream_tail(stream))));
-}
-
-function negate_whole_stream(stream) {
- return pair(-head(stream), () => negate_whole_stream(stream_tail(stream)));
-}
-
-const ones = pair(1, () => ones);
-list_ref(eval_stream(make_alternating_stream(enum_stream(1, 9)), 9), 8);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 9,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`streams can be created and functions with no return statements are still evaluated properly: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const s = stream(true, false, undefined, 1, x=>x, null, -123, head);
-const result = [];
-stream_for_each(item => {result[array_length(result)] = item;}, s);
-stream_ref(s,4)(22) === 22 && stream_ref(s,7)(pair('', '1')) === '1' && result;",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": false,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`while loops use block scoping instead of function scoping: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function test(){
- let x = true;
- while (true) {
- let x = false;
- break;
- }
- return x;
-}
-test();",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cset-machine-apply.ts.snap b/src/cse-machine/__tests__/__snapshots__/cset-machine-apply.ts.snap
deleted file mode 100644
index e640dd35d..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cset-machine-apply.ts.snap
+++ /dev/null
@@ -1,84 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`eval of strings: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval \\"hello\\")
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "hello",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`incorrect use of apply throws error (insufficient arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (apply)
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Expected 2 arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`incorrect use of apply throws error (last argument not a list): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (apply + 1 2 3)
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Last argument of apply must be a list",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`multi-operand apply: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define args '(1 2 3 4 5))
- (apply + 6 7 8 9 10 args)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 55n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`two-operand apply: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define args '(1 2))
- (apply + args)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 3n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cset-machine-eval.ts.snap b/src/cse-machine/__tests__/__snapshots__/cset-machine-eval.ts.snap
deleted file mode 100644
index 1d4858bf9..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cset-machine-eval.ts.snap
+++ /dev/null
@@ -1,224 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`eval of application: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(+ 1 2))
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 3n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of begin: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(begin 1 2 3))
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 3n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of booleans: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval #t)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": true,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of define: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define x 1))
- x
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 1n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of empty list: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '())
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Cannot evaluate null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of if: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(if #t 1 2))
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 1n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of lambda: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(lambda (x) x))
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": [Function],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of numbers: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval 1)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 1n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of quote: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(quote (1 2 3)))
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- SchemeInteger {
- "numberType": 1,
- "value": 1n,
- },
- Array [
- SchemeInteger {
- "numberType": 1,
- "value": 2n,
- },
- Array [
- SchemeInteger {
- "numberType": 1,
- "value": 3n,
- },
- null,
- ],
- ],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of set!: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define x 2)
- (eval '(set! x 1))
- x
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 1n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of strings: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval \\"hello\\")
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "hello",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`eval of symbols: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define hello 1)
- (eval 'hello)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 1n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cset-machine-macros.ts.snap b/src/cse-machine/__tests__/__snapshots__/cset-machine-macros.ts.snap
deleted file mode 100644
index 44a337150..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cset-machine-macros.ts.snap
+++ /dev/null
@@ -1,97 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`definition of a macro: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define-syntax my-let
- (syntax-rules ()
- ((_ ((var expr) ...) body ...)
- ((lambda (var ...) body ...) expr ...))))
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`failed usage of a macro (no matching pattern): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define-syntax my-let
- (syntax-rules ()
- ((_ ((var expr) ...) body ...)
- ((lambda (var ...) body ...) expr ...))))
- (my-let ((x 1) y)
- (+ x y))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: No matching transformer found for macro my-let",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`use of a macro: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (define-syntax my-let
- (syntax-rules ()
- ((_ ((var expr) ...) body ...)
- ((lambda (var ...) body ...) expr ...))))
- (my-let ((x 1) (y 2))
- (+ x y))
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 3n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`use of a more complex macro (recursive): expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
-(define-syntax define-match
- (syntax-rules ()
- ; vars is a pair
- ((_ (front . rest) val)
- (begin
- (if (not (pair? val))
- (error \\"define-match: vars and vals do not match\\"))
- (define-match front (car val))
- (define-match rest (cdr val))))
- ; vars is nil
- ((_ () val)
- ; do nothing
- (if #f #f))
- ; vars is a single symbol
- ((_ sym val)
- (define sym val))))
- (define-match ((x y) z) '((1 2) 3))
- (+ x y z)
- ",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": SchemeInteger {
- "numberType": 1,
- "value": 6n,
- },
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/__snapshots__/cset-machine.ts.snap b/src/cse-machine/__tests__/__snapshots__/cset-machine.ts.snap
deleted file mode 100644
index fc7301ef5..000000000
--- a/src/cse-machine/__tests__/__snapshots__/cset-machine.ts.snap
+++ /dev/null
@@ -1,376 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`evaluating a poorly formed begin throws error (insufficient arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(begin))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: begin requires at least 1 argument!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define throws error (attempt to redefine special form): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define (if x y) 4))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Cannot shadow special form if with a definition!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define throws error (ill formed define-function): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define (x 1 2 3) 4))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Invalid arguments for lambda!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define throws error (insufficient arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: define requires at least 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define throws error (too many arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define x 1 2 3))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: define requires 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (attempt to shadow special form): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax if 4))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Cannot shadow special form if with a macro!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (insufficient arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: define-syntax requires 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (list is not syntax-rules): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax x (foo bar)))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: define-syntax requires a syntax-rules transformer!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (no syntax-rules list): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax x 1))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: define-syntax requires a syntax-rules transformer!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (syntax is not a symbol): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax 1 4))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: define-syntax requires a symbol!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (syntax-rules has non-list rules): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax x (syntax-rules (x) 1)))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Invalid syntax-rules rule!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (syntax-rules has non-symbol literals): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax x (syntax-rules (1 2) (1 1))))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Invalid syntax-rules literals!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (syntax-rules has poor literals list): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax x (syntax-rules x (1 1))))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Invalid syntax-rules literals!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (syntax-rules too few arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax x (syntax-rules)))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: syntax-rules requires at least 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed define-syntax throws error (too many arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(define-syntax x 1 2 3))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: define-syntax requires 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed if throws error (insufficient arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(if))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: if requires at least 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed if throws error (too many arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(if #t 1 2 3))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: if requires at most 3 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed lambda throws error: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(lambda (1 2 3) x))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Invalid arguments for lambda!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed quote throws error (insufficient arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(quote))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: quote requires 1 argument!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed quote throws error (too many arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(quote x y))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: quote requires 1 argument!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed set! throws error (attempt to set! special form): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(set! if 4))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Cannot overwrite special form if with a value!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed set! throws error (insufficient arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(set!))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: set! requires 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a poorly formed set! throws error (too many arguments): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(set! x 1 2 3))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: set! requires 2 arguments!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating a syntax-rules expression (should not exist outside of define-syntax): expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '(syntax-rules (x) (1 1)))
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: syntax-rules must only exist within define-syntax!",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`evaluating null throws error: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "
- (eval '())
- ",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Error: Cannot evaluate null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/cse-machine/__tests__/continuations.ts b/src/cse-machine/__tests__/continuations.ts
index ae957fee3..27b8db157 100644
--- a/src/cse-machine/__tests__/continuations.ts
+++ b/src/cse-machine/__tests__/continuations.ts
@@ -1,4 +1,4 @@
-import { mockContext } from '../../mocks/context'
+import { mockContext } from '../../utils/testing/mocks'
import { Call_cc, Continuation, isCallWithCurrentContinuation } from '../continuations'
import { Control, Stash, Transformers } from '../interpreter'
diff --git a/src/cse-machine/__tests__/cse-machine-errors.ts b/src/cse-machine/__tests__/cse-machine-errors.ts
index 9fa1bdc78..4c4dc199e 100644
--- a/src/cse-machine/__tests__/cse-machine-errors.ts
+++ b/src/cse-machine/__tests__/cse-machine-errors.ts
@@ -3,15 +3,23 @@ import * as _ from 'lodash'
import { Chapter, Variant } from '../../types'
import { stripIndent } from '../../utils/formatters'
-import {
- expectDifferentParsedErrors,
- expectParsedError,
- expectParsedErrorNoSnapshot,
- expectResult
-} from '../../utils/testing'
+import { expectParsedError, expectResult, testFailure } from '../../utils/testing'
+import { TestOptions } from '../../utils/testing/types'
jest.spyOn(_, 'memoize').mockImplementation(func => func as any)
+function expectDifferentParsedErrors(code1: string, code2: string, options: TestOptions = {}) {
+ return expect(
+ testFailure(code1, options).then(error1 => {
+ expect(
+ testFailure(code2, options).then(error2 => {
+ return expect(error1).not.toEqual(error2)
+ })
+ )
+ })
+ ).resolves
+}
+
const undefinedVariable = stripIndent`
im_undefined;
`
@@ -149,7 +157,7 @@ test("Builtins don't create additional errors when it's not their fault", () =>
})
test('Infinite recursion with a block bodied function', () => {
- return expectParsedErrorNoSnapshot(
+ return expectParsedError(
stripIndent`
function i(n) {
return n === 0 ? 0 : 1 + i(n-1);
@@ -161,7 +169,7 @@ test('Infinite recursion with a block bodied function', () => {
}, 15000)
test('Infinite recursion with function calls in argument', () => {
- return expectParsedErrorNoSnapshot(
+ return expectParsedError(
stripIndent`
function i(n, redundant) {
return n === 0 ? 0 : 1 + i(n-1, r());
@@ -178,7 +186,7 @@ test('Infinite recursion with function calls in argument', () => {
}, 20000)
test('Infinite recursion of mutually recursive functions', () => {
- return expectParsedErrorNoSnapshot(
+ return expectParsedError(
stripIndent`
function f(n) {
return n === 0 ? 0 : 1 + g(n - 1);
@@ -931,7 +939,7 @@ test('Cascading js errors work properly', () => {
})
test('Check that stack is at most 10k in size', () => {
- return expectParsedErrorNoSnapshot(
+ return expectParsedError(
stripIndent`
function f(x) {
if (x <= 0) {
diff --git a/src/cse-machine/__tests__/cse-machine-heap.ts b/src/cse-machine/__tests__/cse-machine-heap.ts
index 3565ce6d7..fed7ab1d2 100644
--- a/src/cse-machine/__tests__/cse-machine-heap.ts
+++ b/src/cse-machine/__tests__/cse-machine-heap.ts
@@ -1,4 +1,4 @@
-import { mockClosure, mockContext } from '../../mocks/context'
+import { mockClosure, mockContext } from '../../utils/testing/mocks'
import { runCodeInSource } from '../../runner'
import { Chapter } from '../../types'
import { stripIndent } from '../../utils/formatters'
@@ -11,7 +11,7 @@ test('Heap works correctly', () => {
expect(heap1.getHeap()).toMatchInlineSnapshot(`Set {}`)
const arr = [0] as EnvArray
- const closure = mockClosure(true)
+ const closure = mockClosure()
heap1.add(arr, closure)
heap1.add(arr)
expect(heap1.contains([0] as EnvArray)).toMatchInlineSnapshot(`false`)
@@ -28,7 +28,7 @@ test('Heap works correctly', () => {
`)
const heap2 = new Heap()
- expect(heap1.move(mockClosure(true), heap2)).toMatchInlineSnapshot(`false`)
+ expect(heap1.move(mockClosure(), heap2)).toMatchInlineSnapshot(`false`)
expect(heap1.move(arr, heap2)).toMatchInlineSnapshot(`true`)
expect(heap1.contains(arr)).toMatchInlineSnapshot(`false`)
expect(heap1.getHeap()).toMatchInlineSnapshot(`
diff --git a/src/cse-machine/__tests__/cse-machine-runtime-context.ts b/src/cse-machine/__tests__/cse-machine-runtime-context.ts
index 4c3e48e0a..5a65ceeb8 100644
--- a/src/cse-machine/__tests__/cse-machine-runtime-context.ts
+++ b/src/cse-machine/__tests__/cse-machine-runtime-context.ts
@@ -1,6 +1,6 @@
import * as es from 'estree'
import { IOptions } from '../..'
-import { mockContext } from '../../mocks/context'
+import { mockContext } from '../../utils/testing/mocks'
import { parse } from '../../parser/parser'
import { runCodeInSource } from '../../runner'
import { Chapter, RecursivePartial } from '../../types'
diff --git a/src/cse-machine/__tests__/cse-machine-stdlib.ts b/src/cse-machine/__tests__/cse-machine-stdlib.ts
index a9c8d93ff..88a7c19e1 100644
--- a/src/cse-machine/__tests__/cse-machine-stdlib.ts
+++ b/src/cse-machine/__tests__/cse-machine-stdlib.ts
@@ -436,11 +436,7 @@ test.each([
variant: Variant.EXPLICIT_CONTROL
}).toEqual(returnValue)
} else {
- return snapshotFailure(
- stripIndent(snippet),
- { chapter, variant: Variant.EXPLICIT_CONTROL },
- 'fails'
- )
+ return snapshotFailure(stripIndent(snippet), { chapter, variant: Variant.EXPLICIT_CONTROL })
}
}
)
diff --git a/src/cse-machine/__tests__/cse-machine-unique-id.ts b/src/cse-machine/__tests__/cse-machine-unique-id.ts
index 75a972fef..aa421b1f1 100644
--- a/src/cse-machine/__tests__/cse-machine-unique-id.ts
+++ b/src/cse-machine/__tests__/cse-machine-unique-id.ts
@@ -1,4 +1,4 @@
-import { mockContext } from '../../mocks/context'
+import { mockContext } from '../../utils/testing/mocks'
import { Chapter, type Context, type Environment } from '../../types'
import { stripIndent } from '../../utils/formatters'
import { runCodeInSource } from '../../runner'
diff --git a/src/editors/ace/docTooltip/index.ts b/src/editors/ace/docTooltip/index.ts
index 5d0667f32..a22685f62 100644
--- a/src/editors/ace/docTooltip/index.ts
+++ b/src/editors/ace/docTooltip/index.ts
@@ -4,7 +4,6 @@ import * as source_1_typed from './source_1_typed.json'
import * as source_2 from './source_2.json'
import * as source_2_typed from './source_2_typed.json'
import * as source_3 from './source_3.json'
-import * as source_3_concurrent from './source_3_concurrent.json'
import * as source_3_typed from './source_3_typed.json'
import * as source_4 from './source_4.json'
import * as source_4_typed from './source_4_typed.json'
@@ -45,7 +44,6 @@ export const SourceDocumentation = {
'2': resolveImportInconsistency(source_2),
'2_typed': resolveImportInconsistency(source_2_typed),
'3': resolveImportInconsistency(source_3),
- '3_concurrent': resolveImportInconsistency(source_3_concurrent),
'3_typed': resolveImportInconsistency(source_3_typed),
'4': resolveImportInconsistency(source_4),
'4_typed': resolveImportInconsistency(source_4_typed),
diff --git a/src/index.ts b/src/index.ts
index 70262b05e..f3e007085 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -34,7 +34,6 @@ import { getKeywords, getProgramNames, NameDeclaration } from './name-extractor'
import { htmlRunner, resolvedErrorPromise, sourceFilesRunner } from './runner'
export interface IOptions {
- scheduler: 'preemptive' | 'async'
steps: number
stepLimit: number
executionMethod: ExecutionMethod
@@ -253,12 +252,9 @@ export async function runFilesInContext(
export function resume(result: Result): Finished | ResultError | Promise {
if (result.status === 'finished' || result.status === 'error') {
return result
- } else if (result.status === 'suspended-cse-eval') {
- const value = resumeEvaluate(result.context)
- return CSEResultPromise(result.context, value)
- } else {
- return result.scheduler.run(result.it, result.context)
}
+ const value = resumeEvaluate(result.context)
+ return CSEResultPromise(result.context, value)
}
export function interrupt(context: Context) {
diff --git a/src/infiniteLoops/__tests__/errors.ts b/src/infiniteLoops/__tests__/errors.ts
index 5ca59db4e..52f076aef 100644
--- a/src/infiniteLoops/__tests__/errors.ts
+++ b/src/infiniteLoops/__tests__/errors.ts
@@ -3,7 +3,7 @@ import * as es from 'estree'
import { ExceptionError } from '../../errors/errors'
import { RuntimeSourceError } from '../../errors/runtimeSourceError'
import { TimeoutError } from '../../errors/timeoutErrors'
-import { mockContext } from '../../mocks/context'
+import { mockContext } from '../../utils/testing/mocks'
import { Chapter } from '../../types'
import {
getInfiniteLoopData,
diff --git a/src/infiniteLoops/__tests__/instrument.ts b/src/infiniteLoops/__tests__/instrument.ts
index 56886b86a..e292ef2a0 100644
--- a/src/infiniteLoops/__tests__/instrument.ts
+++ b/src/infiniteLoops/__tests__/instrument.ts
@@ -1,6 +1,6 @@
import { Program } from 'estree'
-import { mockContext } from '../../mocks/context'
+import { mockContext } from '../../utils/testing/mocks'
import { parse } from '../../parser/parser'
import { Chapter } from '../../types'
import { evaluateBinaryExpression, evaluateUnaryExpression } from '../../utils/operators'
@@ -12,24 +12,26 @@ import {
function mockFunctionsAndState() {
const theState = undefined
- const functions = {}
const returnFirst = (...args: any[]) => args[0]
const nothing = (..._args: any[]) => {}
- functions[functionNames.nothingFunction] = nothing
- functions[functionNames.concretize] = returnFirst
- functions[functionNames.hybridize] = returnFirst
- functions[functionNames.wrapArg] = returnFirst
- functions[functionNames.dummify] = returnFirst
- functions[functionNames.saveBool] = returnFirst
- functions[functionNames.saveVar] = returnFirst
- functions[functionNames.preFunction] = nothing
- functions[functionNames.returnFunction] = returnFirst
- functions[functionNames.postLoop] = (_: any, res?: any) => res
- functions[functionNames.enterLoop] = nothing
- functions[functionNames.exitLoop] = nothing
- functions[functionNames.trackLoc] = (_1: any, _2: any, fn?: any) => (fn ? fn() : undefined)
- functions[functionNames.evalB] = evaluateBinaryExpression
- functions[functionNames.evalU] = evaluateUnaryExpression
+
+ const functions = {
+ [functionNames.nothingFunction]: nothing,
+ [functionNames.concretize]: returnFirst,
+ [functionNames.hybridize]: returnFirst,
+ [functionNames.wrapArg]: returnFirst,
+ [functionNames.dummify]: returnFirst,
+ [functionNames.saveBool]: returnFirst,
+ [functionNames.saveVar]: returnFirst,
+ [functionNames.preFunction]: nothing,
+ [functionNames.returnFunction]: returnFirst,
+ [functionNames.postLoop]: (_: any, res?: any) => res,
+ [functionNames.enterLoop]: nothing,
+ [functionNames.exitLoop]: nothing,
+ [functionNames.trackLoc]: (_1: any, _2: any, fn?: any) => (fn ? fn() : undefined),
+ [functionNames.evalB]: evaluateBinaryExpression,
+ [functionNames.evalU]: evaluateUnaryExpression
+ }
return [functions, theState]
}
diff --git a/src/infiniteLoops/__tests__/runtime.ts b/src/infiniteLoops/__tests__/runtime.ts
index 9e7b92880..e12b54793 100644
--- a/src/infiniteLoops/__tests__/runtime.ts
+++ b/src/infiniteLoops/__tests__/runtime.ts
@@ -2,7 +2,7 @@ import type es from 'estree'
import { runInContext } from '../..'
import createContext from '../../createContext'
-import { mockContext } from '../../mocks/context'
+import { mockContext } from '../../utils/testing/mocks'
import { parse } from '../../parser/parser'
import { Chapter, Variant } from '../../types'
import { getInfiniteLoopData, InfiniteLoopError, InfiniteLoopErrorType } from '../errors'
diff --git a/src/interpreter/__tests__/__snapshots__/interpreter-errors.ts.snap b/src/interpreter/__tests__/__snapshots__/interpreter-errors.ts.snap
deleted file mode 100644
index 4f232772a..000000000
--- a/src/interpreter/__tests__/__snapshots__/interpreter-errors.ts.snap
+++ /dev/null
@@ -1,1106 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Access local property: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "({a: 0})[\\"a\\"];",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 0,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Builtins don't create additional errors when it's not their fault: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return a;
-}
-map(f, list(1, 2));",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Name a not declared.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Cascading js errors work properly 1: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function make_alternating_stream(stream) {
- return pair(head(stream), () => make_alternating_stream(
- negate_whole_stream(
- stream_tail(stream))));
-}
-
-function negate_whole_stream(stream) {
- return pair(-head(stream), () => negate_whole_stream(stream_tail(stream)));
-}
-
-const ones = pair(1, () => ones);
-eval_stream(make_alternating_stream(enum_stream(1, 9)), 10);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 8: Error: head(xs) expects a pair as argument xs, but encountered null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Cascading js errors work properly: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function h(p) {
- return head(p);
-}
-
-h(null);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Error: head(xs) expects a pair as argument xs, but encountered null",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when accessing inherited property of object: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "({}).valueOf;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Cannot read inherited property valueOf of {}.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-map = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Cannot assign new value to constant map.
-As map was declared as a constant, its value cannot be changed. You will have to declare a new variable.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin - verbose: expectParsedError 2`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-undefined = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Cannot assign new value to constant undefined.
-As undefined was declared as a constant, its value cannot be changed. You will have to declare a new variable.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "map = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Cannot assign new value to constant map.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when assigning to builtin: expectParsedError 2`] = `
-Object {
- "alertResult": Array [],
- "code": "undefined = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Cannot assign new value to constant undefined.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function in tail call with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-const g = () => 1;
-const f = x => g(x);
-f(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 15: Expected 0 arguments, but got 1.
-Try calling function g again, but with 0 arguments instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function in tail call with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const g = () => 1;
-const f = x => g(x);
-f(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 0 arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too few arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- const f = x => x;
- f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 2: Expected 1 arguments, but got 0.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too few arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- const f = x => x;
- f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 2: Expected 1 arguments, but got 2.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling arrow function with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling builtin function in with too few arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int(\\"\\");",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 2 arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling builtin function in with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "is_number(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 1 arguments, but got 3.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function from member expression with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- const f = [x => x];
- f[0](1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 2: Expected 1 arguments, but got 2.
-Try calling function f[0] again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function from member expression with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = [x => x];
-f[0](1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too few arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- function f(x) {
- return x;
- }
- f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 5, Column 2: Expected 1 arguments, but got 0.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too few arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return x;
-}
-f();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Expected 1 arguments, but got 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too many arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- function f(x) {
- return x;
- }
- f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 5, Column 2: Expected 1 arguments, but got 2.
-Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling function with too many arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f(x) {
- return x;
-}
-f(1, 2);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value "string" - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- 'string'();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value \\"string\\".
-Because \\"string\\" is not a function, you cannot run \\"string\\"().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value "string": expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "'string'();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value \\"string\\".",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value 0 - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- 0();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value 0.
-Because 0 is not a function, you cannot run 0(). If you were planning to perform multiplication by 0, you need to use the * operator.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value 0: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "0();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value 0.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value array - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-[1]();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Calling non-function value [1].
-Because [1] is not a function, you cannot run [1]().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value array: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "[1]();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value [1].",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value null - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- null();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: null literals are not allowed.
-They're not part of the Source §1 specs.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value null: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "null();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: null literals are not allowed.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value object - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-({a: 1})();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Calling non-function value {\\"a\\": 1}.
-Because {\\"a\\": 1} is not a function, you cannot run {\\"a\\": 1}().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value object - verbose: expectParsedError 2`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-({a: 1})();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Calling non-function value {\\"a\\": 1}.
-Because {\\"a\\": 1} is not a function, you cannot run {\\"a\\": 1}().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value object: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "({a: 1})();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value {\\"a\\": 1}.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value true - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- true();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value true.
-Because true is not a function, you cannot run true().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value true: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "true();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value true.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- undefined();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value undefined.
-Because undefined is not a function, you cannot run undefined().
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined with arguments - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
- undefined(1, true);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 2: Calling non-function value undefined.
-Because undefined is not a function, you cannot run undefined(1, true).
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined with arguments: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "undefined(1, true);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value undefined.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when calling non function value undefined: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "undefined();",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Calling non-function value undefined.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring const after function --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-function f() {}
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 6: SyntaxError: Identifier 'f' has already been declared (3:6)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring const after function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {}
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring constant as variable: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring constant: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after const --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-const f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after const: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "const f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after function --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-function f() {}
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {}
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after let --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-let f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring function after let: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let f = x => x;
-function f() {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring let after function --verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-function f() {}
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 3, Column 4: SyntaxError: Identifier 'f' has already been declared (3:4)
-There is a syntax error in your program
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring let after function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {}
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring variable as constant: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let f = x => x;
-const f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error when redeclaring variable: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "let f = x => x;
-let f = x => x;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error with too few arguments passed to rest parameters: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function rest(a, b, ...c) {}
-rest(1);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2: Expected 2 or more arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Error with too many arguments passed to math_sin: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "math_sin(7,8);",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 1 arguments, but got 2.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Nice errors when errors occur inside builtins: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "parse_int(\\"10\\");",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected 2 arguments, but got 1.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Nice errors when errors occur inside builtins: expectParsedError 2`] = `
-Object {
- "alertResult": Array [],
- "code": "parse(\\"'\\");",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: ParseError: SyntaxError: Unterminated string constant (1:0)",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling display function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "display(1);
-display(1, \\"test\\");",
- "displayResult": Array [
- "1",
- "test 1",
- ],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling list function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "list();
-list(1);
-list(1, 2, 3);
-list(1, 2, 3, 4, 5, 6, 6);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- 1,
- Array [
- 2,
- Array [
- 3,
- Array [
- 4,
- Array [
- 5,
- Array [
- 6,
- Array [
- 6,
- null,
- ],
- ],
- ],
- ],
- ],
- ],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling math_max function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "math_max();
-math_max(1, 2);
-math_max(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 3,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling math_min function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "math_min();
-math_min(1, 2);
-math_min(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": 1,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`No error when calling stringify function in with variable arguments: expectResult 1`] = `
-Object {
- "alertResult": Array [],
- "code": "stringify(1, 2);
-stringify(1, 2, 3);",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": "1",
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error when accessing property of function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {
- return 1;
-}
-f.prototype;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Expected object or array, got function.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error when accessing property of null: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "null.prop;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected object or array, got null.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error when accessing property of string: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "'hi'.length;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected object or array, got string.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error when assigning property of function: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "function f() {
- return 1;
-}
-f.prop = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 4: Expected object or array, got function.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error when assigning property of string: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "'hi'.prop = 5;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected object or array, got string.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error with * , error line at , not : expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "12
-*
-'string';",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected number on right hand side of operation, got string.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Type error with non boolean in if statement, error line at if statement, not at 1: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "if (
-1
-) {
- 2;
-} else {}",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Expected boolean as condition, got number.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Undefined variable error is thrown - verbose: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "\\"enable verbose\\";
-im_undefined;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 2, Column 0: Name im_undefined not declared.
-Before you can read the value of im_undefined, you need to declare it as a variable or a constant. You can do this using the let or const keywords.
-",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Undefined variable error is thrown: expectParsedError 1`] = `
-Object {
- "alertResult": Array [],
- "code": "im_undefined;",
- "displayResult": Array [],
- "numErrors": 1,
- "parsedErrors": "Line 1: Name im_undefined not declared.",
- "result": undefined,
- "resultStatus": "error",
- "visualiseListResult": Array [],
-}
-`;
diff --git a/src/interpreter/__tests__/interpreter-errors.ts b/src/interpreter/__tests__/interpreter-errors.ts
deleted file mode 100644
index c12848a00..000000000
--- a/src/interpreter/__tests__/interpreter-errors.ts
+++ /dev/null
@@ -1,1127 +0,0 @@
-// import type { FunctionLike, MockedFunction } from 'jest-mock'
-
-/* tslint:disable:max-line-length */
-// import { memoizedGetModuleManifest } from '../../modules/moduleLoader'
-import { Chapter } from '../../types'
-import { stripIndent } from '../../utils/formatters'
-import {
- expectDifferentParsedErrors,
- expectParsedError,
- expectParsedErrorNoSnapshot,
- expectResult
-} from '../../utils/testing'
-
-jest.mock('../../modules/loader/loaders')
-
-// const asMock = (func: T) => func as MockedFunction
-// const mockedModuleFile = asMock(memoizedGetModuleFile)
-
-const undefinedVariable = stripIndent`
-im_undefined;
-`
-const undefinedVariableVerbose = stripIndent`
-"enable verbose";
-im_undefined;
-`
-
-test('Undefined variable error is thrown', () => {
- return expectParsedError(undefinedVariable).toMatchInlineSnapshot(
- `"Line 1: Name im_undefined not declared."`
- )
-})
-
-test('Undefined variable error is thrown - verbose', () => {
- return expectParsedError(undefinedVariableVerbose).toMatchInlineSnapshot(`
- "Line 2, Column 0: Name im_undefined not declared.
- Before you can read the value of im_undefined, you need to declare it as a variable or a constant. You can do this using the let or const keywords.
- "
- `)
-})
-
-test('Undefined variable error message differs from verbose version', () => {
- return expectDifferentParsedErrors(undefinedVariable, undefinedVariableVerbose).toBe(undefined)
-})
-
-const assignToBuiltin = stripIndent`
-map = 5;
-`
-
-const assignToBuiltinVerbose = stripIndent`
- "enable verbose";
- map = 5;
-`
-
-test('Error when assigning to builtin', () => {
- return expectParsedError(assignToBuiltin, { chapter: Chapter.SOURCE_3 }).toMatchInlineSnapshot(
- `"Line 1: Cannot assign new value to constant map."`
- )
-})
-
-test('Error when assigning to builtin - verbose', () => {
- return expectParsedError(assignToBuiltinVerbose, { chapter: Chapter.SOURCE_3 })
- .toMatchInlineSnapshot(`
- "Line 2, Column 0: Cannot assign new value to constant map.
- As map was declared as a constant, its value cannot be changed. You will have to declare a new variable.
- "
- `)
-})
-
-test('Assigning to builtin error message differs from verbose version', () => {
- return expectDifferentParsedErrors(assignToBuiltin, assignToBuiltinVerbose).toBe(undefined)
-})
-
-const assignToBuiltin1 = stripIndent`
-undefined = 5;
-`
-
-const assignToBuiltinVerbose1 = stripIndent`
- "enable verbose";
- undefined = 5;
-`
-
-test('Error when assigning to builtin', () => {
- return expectParsedError(assignToBuiltin1, { chapter: Chapter.SOURCE_3 }).toMatchInlineSnapshot(
- `"Line 1: Cannot assign new value to constant undefined."`
- )
-})
-
-test('Error when assigning to builtin - verbose', () => {
- return expectParsedError(assignToBuiltinVerbose1, { chapter: Chapter.SOURCE_3 })
- .toMatchInlineSnapshot(`
- "Line 2, Column 0: Cannot assign new value to constant undefined.
- As undefined was declared as a constant, its value cannot be changed. You will have to declare a new variable.
- "
- `)
-})
-
-test('Assigning to builtin error message differs from verbose version', () => {
- return expectDifferentParsedErrors(assignToBuiltin1, assignToBuiltinVerbose1).toBe(undefined)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when assigning to property on undefined', () => {
- return expectParsedError(
- stripIndent`
- undefined.prop = 123;
- `,
- { chapter: Chapter.LIBRARY_PARSER }
- ).toMatchInlineSnapshot(`"Line 1: Cannot assign property prop of undefined"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when assigning to property on variable with value undefined', () => {
- return expectParsedError(
- stripIndent`
- const u = undefined;
- u.prop = 123;
- `,
- { chapter: Chapter.LIBRARY_PARSER }
- ).toMatchInlineSnapshot(`"Line 2: Cannot assign property prop of undefined"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when deeply assigning to property on variable with value undefined', () => {
- return expectParsedError(
- stripIndent`
- const u = undefined;
- u.prop.prop = 123;
- `,
- { chapter: Chapter.LIBRARY_PARSER }
- ).toMatchInlineSnapshot(`"Line 2: Cannot read property prop of undefined"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing property on undefined', () => {
- return expectParsedError(
- stripIndent`
- undefined.prop;
- `,
- { chapter: Chapter.LIBRARY_PARSER }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read property prop of undefined"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when deeply accessing property on undefined', () => {
- return expectParsedError(
- stripIndent`
- undefined.prop.prop;
- `,
- { chapter: Chapter.LIBRARY_PARSER }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read property prop of undefined"`)
-})
-
-test('Nice errors when errors occur inside builtins', () => {
- return expectParsedError(
- stripIndent`
- parse_int("10");
- `,
- { chapter: Chapter.SOURCE_4 }
- ).toMatchInlineSnapshot(`"Line 1: Expected 2 arguments, but got 1."`)
-})
-
-test('Nice errors when errors occur inside builtins', () => {
- return expectParsedError(
- stripIndent`
- parse("'");
- `,
- { chapter: Chapter.SOURCE_4 }
- ).toMatchInlineSnapshot(`"Line 1: ParseError: SyntaxError: Unterminated string constant (1:0)"`)
-})
-
-test("Builtins don't create additional errors when it's not their fault", () => {
- return expectParsedError(
- stripIndent`
- function f(x) {
- return a;
- }
- map(f, list(1, 2));
- `,
- { chapter: Chapter.SOURCE_4 }
- ).toMatchInlineSnapshot(`"Line 2: Name a not declared."`)
-})
-
-test('Infinite recursion with a block bodied function', () => {
- return expectParsedErrorNoSnapshot(
- stripIndent`
- function i(n) {
- return n === 0 ? 0 : 1 + i(n-1);
- }
- i(1000);
- `,
- { chapter: Chapter.SOURCE_4 }
- ).toEqual(expect.stringMatching(/Maximum call stack size exceeded\n *(i\(\d*\)[^i]{2,4}){3}/))
-}, 15000)
-
-test('Infinite recursion with function calls in argument', () => {
- return expectParsedErrorNoSnapshot(
- stripIndent`
- function i(n, redundant) {
- return n === 0 ? 0 : 1 + i(n-1, r());
- }
- function r() {
- return 1;
- }
- i(1000, 1);
- `,
- { chapter: Chapter.SOURCE_4 }
- ).toEqual(
- expect.stringMatching(/Maximum call stack size exceeded\n *(i\(\d*, 1\)[^i]{2,4}){2}[ir]/)
- )
-}, 10000)
-
-test('Infinite recursion of mutually recursive functions', () => {
- return expectParsedErrorNoSnapshot(
- stripIndent`
- function f(n) {
- return n === 0 ? 0 : 1 + g(n - 1);
- }
- function g(n) {
- return 1 + f(n);
- }
- f(1000);
- `,
- { chapter: Chapter.SOURCE_4 }
- ).toEqual(
- expect.stringMatching(
- /Maximum call stack size exceeded\n([^f]*f[^g]*g[^f]*f|[^g]*g[^f]*f[^g]*g)/
- )
- )
-})
-
-const callingNonFunctionValueUndefined = stripIndent`
-undefined();
-`
-
-const callingNonFunctionValueUndefinedVerbose = stripIndent`
-"enable verbose";
- undefined();
-`
-// should not be different when error passing is fixed
-test('Error when calling non function value undefined', () => {
- return expectParsedError(callingNonFunctionValueUndefined, {
- native: true
- }).toMatchInlineSnapshot(`"Line 1: Calling non-function value undefined."`)
-})
-
-test('Error when calling non function value undefined - verbose', () => {
- return expectParsedError(callingNonFunctionValueUndefinedVerbose).toMatchInlineSnapshot(`
- "Line 2, Column 2: Calling non-function value undefined.
- Because undefined is not a function, you cannot run undefined().
- "
- `)
-})
-
-test('Calling non function value undefined error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValueUndefined,
- callingNonFunctionValueUndefinedVerbose
- ).toBe(undefined)
-})
-
-const callingNonFunctionValueUndefinedArgs = stripIndent`
-undefined(1, true);
-`
-
-const callingNonFunctionValueUndefinedArgsVerbose = stripIndent`
-"enable verbose";
- undefined(1, true);
-`
-// should not be different when error passing is fixed
-test('Error when calling non function value undefined with arguments', () => {
- return expectParsedError(callingNonFunctionValueUndefinedArgs, {
- native: false
- }).toMatchInlineSnapshot(`"Line 1: Calling non-function value undefined."`)
-})
-
-test('Error when calling non function value undefined with arguments - verbose', () => {
- return expectParsedError(callingNonFunctionValueUndefinedArgsVerbose).toMatchInlineSnapshot(`
- "Line 2, Column 2: Calling non-function value undefined.
- Because undefined is not a function, you cannot run undefined(1, true).
- "
- `)
-})
-
-test('Calling non function value undefined with arguments error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValueUndefinedArgs,
- callingNonFunctionValueUndefinedArgsVerbose
- ).toBe(undefined)
-})
-
-const callingNonFunctionValueNull = stripIndent`
-null();
-`
-
-const callingNonFunctionValueNullVerbose = stripIndent`
-"enable verbose";
- null();
-`
-
-test('Error when calling non function value null', () => {
- return expectParsedError(callingNonFunctionValueNull).toMatchInlineSnapshot(
- `"Line 1: null literals are not allowed."`
- )
-})
-
-test('Error when calling non function value null - verbose', () => {
- return expectParsedError(callingNonFunctionValueNullVerbose).toMatchInlineSnapshot(`
- "Line 2, Column 2: null literals are not allowed.
- They're not part of the Source §1 specs.
- "
- `)
-})
-
-test('Calling non function value null error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValueNull,
- callingNonFunctionValueNullVerbose
- ).toBe(undefined)
-})
-
-const callingNonFunctionValueTrue = stripIndent`
-true();
-`
-const callingNonFunctionValueTrueVerbose = stripIndent`
-"enable verbose";
- true();
-`
-
-test('Error when calling non function value true', () => {
- return expectParsedError(callingNonFunctionValueTrue, { native: true }).toMatchInlineSnapshot(
- `"Line 1: Calling non-function value true."`
- )
-})
-
-test('Error when calling non function value true - verbose', () => {
- return expectParsedError(callingNonFunctionValueTrueVerbose).toMatchInlineSnapshot(`
- "Line 2, Column 2: Calling non-function value true.
- Because true is not a function, you cannot run true().
- "
- `)
-})
-
-test('Calling non function value true error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValueTrue,
- callingNonFunctionValueTrueVerbose
- ).toBe(undefined)
-})
-
-const callingNonFunctionValue0 = stripIndent`
-0();
-`
-
-const callingNonFunctionValue0Verbose = stripIndent`
-"enable verbose";
- 0();
-`
-
-test('Error when calling non function value 0', () => {
- return expectParsedError(callingNonFunctionValue0, { native: true }).toMatchInlineSnapshot(
- `"Line 1: Calling non-function value 0."`
- )
-})
-
-test('Error when calling non function value 0 - verbose', () => {
- return expectParsedError(callingNonFunctionValue0Verbose).toMatchInlineSnapshot(`
- "Line 2, Column 2: Calling non-function value 0.
- Because 0 is not a function, you cannot run 0(). If you were planning to perform multiplication by 0, you need to use the * operator.
- "
- `)
-})
-
-test('Calling non function value 0 error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValue0,
- callingNonFunctionValue0Verbose
- ).toBe(undefined)
-})
-
-const callingNonFunctionValueString = stripIndent`
-'string'();
-`
-
-const callingNonFunctionValueStringVerbose = stripIndent`
-"enable verbose";
- 'string'();
-`
-
-test('Error when calling non function value "string"', () => {
- return expectParsedError(callingNonFunctionValueString, { native: true }).toMatchInlineSnapshot(
- `"Line 1: Calling non-function value \\"string\\"."`
- )
-})
-
-test('Error when calling non function value "string" - verbose', () => {
- return expectParsedError(callingNonFunctionValueStringVerbose).toMatchInlineSnapshot(`
- "Line 2, Column 2: Calling non-function value \\"string\\".
- Because \\"string\\" is not a function, you cannot run \\"string\\"().
- "
- `)
-})
-
-test('Calling non function value string error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValueString,
- callingNonFunctionValueStringVerbose
- ).toBe(undefined)
-})
-
-const callingNonFunctionValueArray = stripIndent`
-[1]();
-`
-
-const callingNonFunctionValueArrayVerbose = stripIndent`
-"enable verbose";
-[1]();
-`
-
-test('Error when calling non function value array', () => {
- return expectParsedError(callingNonFunctionValueArray, {
- chapter: Chapter.SOURCE_3,
- native: true
- }).toMatchInlineSnapshot(`"Line 1: Calling non-function value [1]."`)
-})
-
-test('Error when calling non function value array - verbose', () => {
- return expectParsedError(callingNonFunctionValueArrayVerbose, { chapter: Chapter.SOURCE_3 })
- .toMatchInlineSnapshot(`
- "Line 2, Column 0: Calling non-function value [1].
- Because [1] is not a function, you cannot run [1]().
- "
- `)
-})
-
-test('Calling non function value array error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValueArray,
- callingNonFunctionValueArrayVerbose
- ).toBe(undefined)
-})
-
-const callingNonFunctionValueObject = stripIndent`
-({a: 1})();
-`
-
-const callingNonFunctionValueObjectVerbose = stripIndent`
-"enable verbose";
-({a: 1})();
-`
-
-test('Error when calling non function value object', () => {
- return expectParsedError(callingNonFunctionValueObject, {
- chapter: Chapter.LIBRARY_PARSER
- }).toMatchInlineSnapshot(`"Line 1: Calling non-function value {\\"a\\": 1}."`)
-})
-
-test('Error when calling non function value object - verbose', () => {
- return expectParsedError(callingNonFunctionValueObjectVerbose, {
- chapter: Chapter.LIBRARY_PARSER
- }).toMatchInlineSnapshot(`
- "Line 2, Column 0: Calling non-function value {\\"a\\": 1}.
- Because {\\"a\\": 1} is not a function, you cannot run {\\"a\\": 1}().
- "
- `)
-})
-
-test('Calling non function value object error message differs from verbose version', () => {
- return expectDifferentParsedErrors(
- callingNonFunctionValueObject,
- callingNonFunctionValueObjectVerbose
- ).toBe(undefined)
-})
-
-test('Error when calling non function value object - verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- ({a: 1})();
- `,
- { chapter: Chapter.LIBRARY_PARSER }
- ).toMatchInlineSnapshot(`
- "Line 2, Column 0: Calling non-function value {\\"a\\": 1}.
- Because {\\"a\\": 1} is not a function, you cannot run {\\"a\\": 1}().
- "
- `)
-})
-
-test('Error when calling function with too few arguments', () => {
- return expectParsedError(
- stripIndent`
- function f(x) {
- return x;
- }
- f();
- `,
- { native: true }
- ).toMatchInlineSnapshot(`"Line 4: Expected 1 arguments, but got 0."`)
-})
-
-test('Error when calling function with too few arguments - verbose', () => {
- return expectParsedError(stripIndent`
- "enable verbose";
- function f(x) {
- return x;
- }
- f();
- `).toMatchInlineSnapshot(`
- "Line 5, Column 2: Expected 1 arguments, but got 0.
- Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
- "
- `)
-})
-
-test('Error when calling function with too many arguments', () => {
- return expectParsedError(
- stripIndent`
- function f(x) {
- return x;
- }
- f(1, 2);
- `,
- { native: true }
- ).toMatchInlineSnapshot(`"Line 4: Expected 1 arguments, but got 2."`)
-})
-
-test('Error when calling function with too many arguments - verbose', () => {
- return expectParsedError(stripIndent`
- "enable verbose";
- function f(x) {
- return x;
- }
- f(1, 2);
- `).toMatchInlineSnapshot(`
- "Line 5, Column 2: Expected 1 arguments, but got 2.
- Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
- "
- `)
-})
-
-test('Error when calling arrow function with too few arguments', () => {
- return expectParsedError(
- stripIndent`
- const f = x => x;
- f();
- `,
- { native: true }
- ).toMatchInlineSnapshot(`"Line 2: Expected 1 arguments, but got 0."`)
-})
-
-test('Error when calling arrow function with too few arguments - verbose', () => {
- return expectParsedError(stripIndent`
- "enable verbose";
- const f = x => x;
- f();
- `).toMatchInlineSnapshot(`
- "Line 3, Column 2: Expected 1 arguments, but got 0.
- Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
- "
- `)
-})
-
-test('Error when calling arrow function with too many arguments', () => {
- return expectParsedError(
- stripIndent`
- const f = x => x;
- f(1, 2);
- `,
- { native: true }
- ).toMatchInlineSnapshot(`"Line 2: Expected 1 arguments, but got 2."`)
-})
-
-test('Error when calling arrow function with too many arguments - verbose', () => {
- return expectParsedError(stripIndent`
- "enable verbose";
- const f = x => x;
- f(1, 2);
- `).toMatchInlineSnapshot(`
- "Line 3, Column 2: Expected 1 arguments, but got 2.
- Try calling function f again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
- "
- `)
-})
-
-test('Error when calling function from member expression with too many arguments', () => {
- return expectParsedError(
- stripIndent`
- const f = [x => x];
- f[0](1, 2);
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: Expected 1 arguments, but got 2."`)
-})
-
-test('Error when calling function from member expression with too many arguments - verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- const f = [x => x];
- f[0](1, 2);
- `,
- { chapter: Chapter.SOURCE_3 }
- ).toMatchInlineSnapshot(`
- "Line 3, Column 2: Expected 1 arguments, but got 2.
- Try calling function f[0] again, but with 1 argument instead. Remember that arguments are separated by a ',' (comma).
- "
- `)
-})
-
-test('Error when calling arrow function in tail call with too many arguments - verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- const g = () => 1;
- const f = x => g(x);
- f(1);
- `
- ).toMatchInlineSnapshot(`
- "Line 3, Column 15: Expected 0 arguments, but got 1.
- Try calling function g again, but with 0 arguments instead. Remember that arguments are separated by a ',' (comma).
- "
- `)
-})
-
-test('Error when calling arrow function in tail call with too many arguments', () => {
- return expectParsedError(
- stripIndent`
- const g = () => 1;
- const f = x => g(x);
- f(1);
- `,
- { native: true }
- ).toMatchInlineSnapshot(`"Line 2: Expected 0 arguments, but got 1."`)
-})
-
-test('Error when calling builtin function in with too many arguments', () => {
- return expectParsedError(
- stripIndent`
- is_number(1, 2, 3);
- `,
- { native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected 1 arguments, but got 3."`)
-})
-
-test('Error when calling builtin function in with too few arguments', () => {
- return expectParsedError(
- stripIndent`
- parse_int("");
- `,
- { native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected 2 arguments, but got 1."`)
-})
-
-test('No error when calling list function in with variable arguments', () => {
- return expectResult(
- stripIndent`
- list();
- list(1);
- list(1, 2, 3);
- list(1, 2, 3, 4, 5, 6, 6);
- `,
- { native: true, chapter: Chapter.SOURCE_2 }
- ).toMatchInlineSnapshot(`
- Array [
- 1,
- Array [
- 2,
- Array [
- 3,
- Array [
- 4,
- Array [
- 5,
- Array [
- 6,
- Array [
- 6,
- null,
- ],
- ],
- ],
- ],
- ],
- ],
- ]
- `)
-})
-
-test('No error when calling display function in with variable arguments', () => {
- return expectResult(
- stripIndent`
- display(1);
- display(1, "test");
- `,
- { native: true, chapter: Chapter.SOURCE_2 }
- ).toMatchInlineSnapshot(`1`)
-})
-
-test('No error when calling stringify function in with variable arguments', () => {
- return expectResult(
- stripIndent`
- stringify(1, 2);
- stringify(1, 2, 3);
- `,
- { native: true, chapter: Chapter.SOURCE_2 }
- ).toMatchInlineSnapshot(`"1"`)
-})
-
-test('No error when calling math_max function in with variable arguments', () => {
- return expectResult(
- stripIndent`
- math_max();
- math_max(1, 2);
- math_max(1, 2, 3);
- `,
- { native: true, chapter: Chapter.SOURCE_2 }
- ).toMatchInlineSnapshot(`3`)
-})
-
-test('No error when calling math_min function in with variable arguments', () => {
- return expectResult(
- stripIndent`
- math_min();
- math_min(1, 2);
- math_min(1, 2, 3);
- `,
- { native: true, chapter: Chapter.SOURCE_2 }
- ).toMatchInlineSnapshot(`1`)
-})
-
-test('Error with too many arguments passed to math_sin', () => {
- return expectParsedError(
- stripIndent`
- math_sin(7,8);
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected 1 arguments, but got 2."`)
-})
-
-test('Error with too few arguments passed to rest parameters', () => {
- return expectParsedError(
- stripIndent`
- function rest(a, b, ...c) {}
- rest(1);
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: Expected 2 or more arguments, but got 1."`)
-})
-
-test('Error when redeclaring constant', () => {
- return expectParsedError(
- stripIndent`
- const f = x => x;
- const f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)"`)
-})
-
-test('Error when redeclaring constant as variable', () => {
- return expectParsedError(
- stripIndent`
- const f = x => x;
- let f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)"`)
-})
-
-test('Error when redeclaring variable as constant', () => {
- return expectParsedError(
- stripIndent`
- let f = x => x;
- const f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)"`)
-})
-
-test('Error when redeclaring variable', () => {
- return expectParsedError(
- stripIndent`
- let f = x => x;
- let f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)"`)
-})
-
-test('Error when redeclaring function after let', () => {
- return expectParsedError(
- stripIndent`
- let f = x => x;
- function f() {}
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)"`)
-})
-
-test('Error when redeclaring function after let --verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- let f = x => x;
- function f() {}
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`
- "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
- There is a syntax error in your program
- "
- `)
-})
-
-test('Error when redeclaring function after function', () => {
- return expectParsedError(
- stripIndent`
- function f() {}
- function f() {}
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)"`)
-})
-
-test('Error when redeclaring function after function --verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- function f() {}
- function f() {}
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`
- "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
- There is a syntax error in your program
- "
- `)
-})
-
-test('Error when redeclaring function after const', () => {
- return expectParsedError(
- stripIndent`
- const f = x => x;
- function f() {}
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:9)"`)
-})
-
-test('Error when redeclaring function after const --verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- const f = x => x;
- function f() {}
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`
- "Line 3, Column 9: SyntaxError: Identifier 'f' has already been declared (3:9)
- There is a syntax error in your program
- "
- `)
-})
-
-test('Error when redeclaring const after function', () => {
- return expectParsedError(
- stripIndent`
- function f() {}
- const f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:6)"`)
-})
-
-test('Error when redeclaring const after function --verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- function f() {}
- const f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`
- "Line 3, Column 6: SyntaxError: Identifier 'f' has already been declared (3:6)
- There is a syntax error in your program
- "
- `)
-})
-
-test('Error when redeclaring let after function', () => {
- return expectParsedError(
- stripIndent`
- function f() {}
- let f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`"Line 2: SyntaxError: Identifier 'f' has already been declared (2:4)"`)
-})
-
-test('Error when redeclaring let after function --verbose', () => {
- return expectParsedError(
- stripIndent`
- "enable verbose";
- function f() {}
- let f = x => x;
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(`
- "Line 3, Column 4: SyntaxError: Identifier 'f' has already been declared (3:4)
- There is a syntax error in your program
- "
- `)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing property of null', () => {
- return expectParsedError(
- stripIndent`
- null["prop"];
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read property prop of null"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing property of undefined', () => {
- return expectParsedError(
- stripIndent`
- undefined["prop"];
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read property prop of undefined"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing inherited property of builtin', () => {
- return expectParsedError(
- stripIndent`
- pair["constructor"];
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`
- "Line 1: Cannot read inherited property constructor of function pair(left, right) {
- [implementation hidden]
- }"
- `)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing inherited property of function', () => {
- return expectParsedError(
- stripIndent`
- function f() {}
- f["constructor"];
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 2: Cannot read inherited property constructor of function f() {}"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing inherited property of arrow function', () => {
- return expectParsedError(
- stripIndent`
- (() => 1)["constructor"];
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read inherited property constructor of () => 1"`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing inherited property of array', () => {
- return expectParsedError(
- stripIndent`
- [].push;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read inherited property push of []"`)
-})
-
-test('Error when accessing inherited property of object', () => {
- return expectParsedError(
- stripIndent`
- ({}).valueOf;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read inherited property valueOf of {}."`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing inherited property of string', () => {
- return expectParsedError(
- stripIndent`
- 'hi'.includes;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read inherited property includes of \\"hi\\""`)
-})
-
-// NOTE: Obsoleted due to strict types on member access
-test.skip('Error when accessing inherited property of number', () => {
- return expectParsedError(
- stripIndent`
- (1).toPrecision;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Cannot read inherited property toPrecision of 1"`)
-})
-
-test('Access local property', () => {
- return expectResult(
- stripIndent`
- ({a: 0})["a"];
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`0`)
-})
-
-test('Type error when accessing property of null', () => {
- return expectParsedError(
- stripIndent`
- null.prop;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected object or array, got null."`)
-})
-
-test('Type error when accessing property of string', () => {
- return expectParsedError(
- stripIndent`
- 'hi'.length;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected object or array, got string."`)
-})
-
-test('Type error when accessing property of function', () => {
- return expectParsedError(
- stripIndent`
- function f() {
- return 1;
- }
- f.prototype;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 4: Expected object or array, got function."`)
-})
-
-test('Type error when assigning property of string', () => {
- return expectParsedError(
- stripIndent`
- 'hi'.prop = 5;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected object or array, got string."`)
-})
-
-test('Type error when assigning property of function', () => {
- return expectParsedError(
- stripIndent`
- function f() {
- return 1;
- }
- f.prop = 5;
- `,
- { chapter: Chapter.LIBRARY_PARSER, native: true }
- ).toMatchInlineSnapshot(`"Line 4: Expected object or array, got function."`)
-})
-
-test('Type error with non boolean in if statement, error line at if statement, not at 1', () => {
- return expectParsedError(
- stripIndent`
- if (
- 1
- ) {
- 2;
- } else {}
- `,
- { chapter: Chapter.SOURCE_1, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected boolean as condition, got number."`)
-})
-
-test('Type error with * , error line at , not ', () => {
- return expectParsedError(
- stripIndent`
- 12
- *
- 'string';
- `,
- { chapter: Chapter.SOURCE_1, native: true }
- ).toMatchInlineSnapshot(`"Line 1: Expected number on right hand side of operation, got string."`)
-})
-
-test('Cascading js errors work properly 1', () => {
- return expectParsedError(
- stripIndent`
- function make_alternating_stream(stream) {
- return pair(head(stream), () => make_alternating_stream(
- negate_whole_stream(
- stream_tail(stream))));
- }
-
- function negate_whole_stream(stream) {
- return pair(-head(stream), () => negate_whole_stream(stream_tail(stream)));
- }
-
- const ones = pair(1, () => ones);
- eval_stream(make_alternating_stream(enum_stream(1, 9)), 10);
- `,
- { chapter: Chapter.SOURCE_3, native: true }
- ).toMatchInlineSnapshot(
- `"Line 8: Error: head(xs) expects a pair as argument xs, but encountered null"`
- )
-})
-
-test('Cascading js errors work properly', () => {
- return expectParsedError(
- stripIndent`
- function h(p) {
- return head(p);
- }
-
- h(null);
- `,
- { chapter: Chapter.SOURCE_2, native: true }
- ).toMatchInlineSnapshot(
- `"Line 2: Error: head(xs) expects a pair as argument xs, but encountered null"`
- )
-})
diff --git a/src/interpreter/closure.ts b/src/interpreter/closure.ts
deleted file mode 100644
index a781d5f57..000000000
--- a/src/interpreter/closure.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-/* tslint:disable:max-classes-per-file */
-import { generate } from 'astring'
-import * as es from 'estree'
-
-import {
- hasReturnStatement,
- isBlockStatement,
- isStatementSequence,
- uniqueId
-} from '../cse-machine/utils'
-import { Context, Environment, StatementSequence, Value } from '../types'
-import {
- blockArrowFunction,
- blockStatement,
- callExpression,
- identifier,
- returnStatement
-} from '../utils/ast/astCreator'
-import { apply } from './interpreter'
-
-const closureToJS = (value: Closure, context: Context, klass: string) => {
- function DummyClass(this: Closure) {
- const args: Value[] = Array.prototype.slice.call(arguments)
- const gen = apply(context, value, args, callExpression(identifier(klass), args), this)
- let it = gen.next()
- while (!it.done) {
- it = gen.next()
- }
- return it.value
- }
- Object.defineProperty(DummyClass, 'name', {
- value: klass
- })
- Object.setPrototypeOf(DummyClass, () => undefined)
- Object.defineProperty(DummyClass, 'Inherits', {
- value: (Parent: Value) => {
- DummyClass.prototype = Object.create(Parent.prototype)
- DummyClass.prototype.constructor = DummyClass
- }
- })
- DummyClass.toString = () => generate(value.originalNode)
- DummyClass.call = (thisArg: Value, ...args: Value[]): any => {
- return DummyClass.apply(thisArg, args)
- }
- return DummyClass
-}
-
-class Callable extends Function {
- constructor(f: any) {
- super()
- return Object.setPrototypeOf(f, new.target.prototype)
- }
-}
-
-/**
- * Models function value in the interpreter environment.
- */
-export default class Closure extends Callable {
- public static makeFromArrowFunction(
- node: es.ArrowFunctionExpression,
- environment: Environment,
- context: Context,
- dummyReturn?: boolean,
- predefined?: boolean
- ) {
- const functionBody: es.BlockStatement | StatementSequence =
- !isBlockStatement(node.body) && !isStatementSequence(node.body)
- ? blockStatement([returnStatement(node.body, node.body.loc)], node.body.loc)
- : dummyReturn && !hasReturnStatement(node.body)
- ? blockStatement(
- [
- ...node.body.body,
- returnStatement(identifier('undefined', node.body.loc), node.body.loc)
- ],
- node.body.loc
- )
- : node.body
-
- const closure = new Closure(
- blockArrowFunction(node.params as es.Identifier[], functionBody, node.loc),
- environment,
- context,
- predefined
- )
-
- // Set the closure's node to point back at the original one
- closure.originalNode = node
-
- return closure
- }
-
- /** Unique ID defined for closure */
- public readonly id: string
-
- /** String representation of the closure */
- public functionName: string
-
- /** Fake closure function */
- // tslint:disable-next-line:ban-types
- public fun: Function
-
- /** Keeps track of whether the closure is a pre-defined function */
- public preDefined?: boolean
-
- /** The original node that created this Closure */
- public originalNode: es.Function | es.ArrowFunctionExpression
-
- constructor(
- public node: es.Function | es.ArrowFunctionExpression,
- public environment: Environment,
- context: Context,
- isPredefined?: boolean
- ) {
- super(function (this: any, ...args: any[]) {
- return funJS.apply(this, args)
- })
- this.originalNode = node
- this.id = uniqueId(context)
- if (this.node.type === 'FunctionDeclaration' && this.node.id !== null) {
- this.functionName = this.node.id.name
- } else {
- this.functionName =
- (this.node.params.length === 1 ? '' : '(') +
- this.node.params.map((o: es.Identifier) => o.name).join(', ') +
- (this.node.params.length === 1 ? '' : ')') +
- ' => ...'
- }
- // TODO: Investigate how relevant this really is.
- // .fun seems to only be used in interpreter's NewExpression handler, which uses .fun.prototype.
- const funJS = closureToJS(this, context, this.functionName)
- this.fun = funJS
- this.preDefined = isPredefined == undefined ? undefined : isPredefined
- }
-
- public toString(): string {
- return generate(this.originalNode)
- }
-}
diff --git a/src/interpreter/interpreter.ts b/src/interpreter/interpreter.ts
deleted file mode 100644
index ae23f7655..000000000
--- a/src/interpreter/interpreter.ts
+++ /dev/null
@@ -1,858 +0,0 @@
-/* tslint:disable:max-classes-per-file */
-import type es from 'estree'
-import { isEmpty } from 'lodash'
-
-import { UNKNOWN_LOCATION } from '../constants'
-import Heap from '../cse-machine/heap'
-import { uniqueId } from '../cse-machine/utils'
-import * as errors from '../errors/errors'
-import { RuntimeSourceError } from '../errors/runtimeSourceError'
-import { checkEditorBreakpoints } from '../stdlib/inspector'
-import type { Context, ContiguousArrayElements, Environment, Node, Value } from '../types'
-import * as create from '../utils/ast/astCreator'
-import { conditionalExpression, literal, primitive } from '../utils/ast/astCreator'
-import { getModuleDeclarationSource } from '../utils/ast/helpers'
-import { evaluateBinaryExpression, evaluateUnaryExpression } from '../utils/operators'
-import * as rttc from '../utils/rttc'
-import Closure from './closure'
-
-class BreakValue {}
-
-class ContinueValue {}
-
-class ReturnValue {
- constructor(public value: Value) {}
-}
-
-class TailCallReturnValue {
- constructor(public callee: Closure, public args: Value[], public node: es.CallExpression) {}
-}
-
-class Thunk {
- public value: Value
- public isMemoized: boolean
- constructor(public exp: Node, public env: Environment) {
- this.isMemoized = false
- this.value = null
- }
-}
-
-function* forceIt(val: any, context: Context): Value {
- if (val instanceof Thunk) {
- if (val.isMemoized) return val.value
-
- pushEnvironment(context, val.env)
- const evalRes = yield* actualValue(val.exp, context)
- popEnvironment(context)
- val.value = evalRes
- val.isMemoized = true
- return evalRes
- } else return val
-}
-
-export function* actualValue(exp: Node, context: Context): Value {
- const evalResult = yield* evaluate(exp, context)
- const forced = yield* forceIt(evalResult, context)
- return forced
-}
-
-const createEnvironment = (
- context: Context,
- closure: Closure,
- args: Value[],
- callExpression?: es.CallExpression
-): Environment => {
- const environment: Environment = {
- name: closure.functionName, // TODO: Change this
- tail: closure.environment,
- head: {},
- heap: new Heap(),
- id: uniqueId(context)
- }
- if (callExpression) {
- environment.callExpression = {
- ...callExpression,
- arguments: args.map(primitive)
- }
- }
- closure.node.params.forEach((param, index) => {
- if (param.type === 'RestElement') {
- environment.head[(param.argument as es.Identifier).name] = args.slice(index)
- } else {
- environment.head[(param as es.Identifier).name] = args[index]
- }
- })
- return environment
-}
-
-export const createBlockEnvironment = (
- context: Context,
- name = 'blockEnvironment'
-): Environment => {
- return {
- name,
- tail: currentEnvironment(context),
- head: {},
- heap: new Heap(),
- id: uniqueId(context)
- }
-}
-
-const handleRuntimeError = (context: Context, error: RuntimeSourceError): never => {
- context.errors.push(error)
- context.runtime.environments = context.runtime.environments.slice(
- -context.numberOfOuterEnvironments
- )
- throw error
-}
-
-const DECLARED_BUT_NOT_YET_ASSIGNED = Symbol('Used to implement block scope')
-
-function declareIdentifier(context: Context, name: string, node: Node) {
- const environment = currentEnvironment(context)
- if (environment.head.hasOwnProperty(name)) {
- const descriptors = Object.getOwnPropertyDescriptors(environment.head)
-
- return handleRuntimeError(
- context,
- new errors.VariableRedeclaration(node, name, descriptors[name].writable)
- )
- }
- environment.head[name] = DECLARED_BUT_NOT_YET_ASSIGNED
- return environment
-}
-
-function declareVariables(context: Context, node: es.VariableDeclaration) {
- for (const declaration of node.declarations) {
- declareIdentifier(context, (declaration.id as es.Identifier).name, node)
- }
-}
-
-function declareFunctionsAndVariables(context: Context, node: es.BlockStatement) {
- for (const statement of node.body) {
- switch (statement.type) {
- case 'VariableDeclaration':
- declareVariables(context, statement)
- break
- case 'FunctionDeclaration':
- if (statement.id === null) {
- throw new Error(
- 'Encountered a FunctionDeclaration node without an identifier. This should have been caught when parsing.'
- )
- }
- declareIdentifier(context, statement.id.name, statement)
- break
- }
- }
-}
-
-function defineVariable(context: Context, name: string, value: Value, constant = false) {
- const environment = currentEnvironment(context)
-
- if (environment.head[name] !== DECLARED_BUT_NOT_YET_ASSIGNED) {
- return handleRuntimeError(
- context,
- new errors.VariableRedeclaration(context.runtime.nodes[0]!, name, !constant)
- )
- }
-
- Object.defineProperty(environment.head, name, {
- value,
- writable: !constant,
- enumerable: true
- })
-
- return environment
-}
-
-function* visit(context: Context, node: Node) {
- checkEditorBreakpoints(context, node)
- context.runtime.nodes.unshift(node)
- yield context
-}
-
-function* leave(context: Context) {
- context.runtime.break = false
- context.runtime.nodes.shift()
- yield context
-}
-
-const currentEnvironment = (context: Context) => context.runtime.environments[0]
-const replaceEnvironment = (context: Context, environment: Environment) => {
- context.runtime.environments[0] = environment
- context.runtime.environmentTree.insert(environment)
-}
-const popEnvironment = (context: Context) => context.runtime.environments.shift()
-export const pushEnvironment = (context: Context, environment: Environment) => {
- context.runtime.environments.unshift(environment)
- context.runtime.environmentTree.insert(environment)
-}
-
-const getVariable = (context: Context, name: string) => {
- let environment: Environment | null = currentEnvironment(context)
- while (environment) {
- if (environment.head.hasOwnProperty(name)) {
- if (environment.head[name] === DECLARED_BUT_NOT_YET_ASSIGNED) {
- return handleRuntimeError(
- context,
- new errors.UnassignedVariable(name, context.runtime.nodes[0])
- )
- } else {
- return environment.head[name]
- }
- } else {
- environment = environment.tail
- }
- }
- return handleRuntimeError(context, new errors.UndefinedVariable(name, context.runtime.nodes[0]))
-}
-
-const setVariable = (context: Context, name: string, value: any) => {
- let environment: Environment | null = currentEnvironment(context)
- while (environment) {
- if (environment.head.hasOwnProperty(name)) {
- if (environment.head[name] === DECLARED_BUT_NOT_YET_ASSIGNED) {
- break
- }
- const descriptors = Object.getOwnPropertyDescriptors(environment.head)
- if (descriptors[name].writable) {
- environment.head[name] = value
- return undefined
- }
- return handleRuntimeError(
- context,
- new errors.ConstAssignment(context.runtime.nodes[0]!, name)
- )
- } else {
- environment = environment.tail
- }
- }
- return handleRuntimeError(context, new errors.UndefinedVariable(name, context.runtime.nodes[0]))
-}
-
-const checkNumberOfArguments = (
- context: Context,
- callee: Closure | Value,
- args: Value[],
- exp: es.CallExpression
-) => {
- if (callee instanceof Closure) {
- const params = callee.node.params
- const hasVarArgs = params[params.length - 1]?.type === 'RestElement'
- if (hasVarArgs ? params.length - 1 > args.length : params.length !== args.length) {
- return handleRuntimeError(
- context,
- new errors.InvalidNumberOfArguments(
- exp,
- hasVarArgs ? params.length - 1 : params.length,
- args.length,
- hasVarArgs
- )
- )
- }
- } else {
- const hasVarArgs = callee.minArgsNeeded != undefined
- if (hasVarArgs ? callee.minArgsNeeded > args.length : callee.length !== args.length) {
- return handleRuntimeError(
- context,
- new errors.InvalidNumberOfArguments(
- exp,
- hasVarArgs ? callee.minArgsNeeded : callee.length,
- args.length,
- hasVarArgs
- )
- )
- }
- }
- return undefined
-}
-
-function* getArgs(context: Context, call: es.CallExpression) {
- const args = []
- for (const arg of call.arguments) {
- if (arg.type === 'SpreadElement') {
- args.push(...(yield* actualValue(arg.argument, context)))
- } else {
- args.push(yield* actualValue(arg, context))
- }
- }
- return args
-}
-
-function transformLogicalExpression(node: es.LogicalExpression): es.ConditionalExpression {
- if (node.operator === '&&') {
- return conditionalExpression(node.left, node.right, literal(false), node.loc)
- } else {
- return conditionalExpression(node.left, literal(true), node.right, node.loc)
- }
-}
-
-function* reduceIf(
- node: es.IfStatement | es.ConditionalExpression,
- context: Context
-): IterableIterator {
- const test = yield* actualValue(node.test, context)
-
- const error = rttc.checkIfStatement(node, test, context.chapter)
- if (error) {
- return handleRuntimeError(context, error)
- }
-
- return test ? node.consequent : node.alternate
-}
-
-export type Evaluator = (node: T, context: Context) => IterableIterator
-
-function* evaluateBlockStatement(context: Context, node: es.BlockStatement) {
- declareFunctionsAndVariables(context, node)
- let result
- for (const statement of node.body) {
- result = yield* evaluate(statement, context)
- if (
- result instanceof ReturnValue ||
- result instanceof TailCallReturnValue ||
- result instanceof BreakValue ||
- result instanceof ContinueValue
- ) {
- break
- }
- }
- return result
-}
-
-/**
- * WARNING: Do not use object literal shorthands, e.g.
- * {
- * *Literal(node: es.Literal, ...) {...},
- * *ThisExpression(node: es.ThisExpression, ..._ {...},
- * ...
- * }
- * They do not minify well, raising uncaught syntax errors in production.
- * See: https://github.com/webpack/webpack/issues/7566
- */
-// tslint:disable:object-literal-shorthand
-// prettier-ignore
-export const evaluators: { [nodeType: string]: Evaluator } = {
- /** Simple Values */
- Literal: function*(node: es.Literal, _context: Context) {
- return node.value
- },
-
- TemplateLiteral: function*(node: es.TemplateLiteral) {
- // Expressions like `${1}` are not allowed, so no processing needed
- return node.quasis[0].value.cooked
- },
-
- ThisExpression: function*(node: es.ThisExpression, context: Context) {
- return currentEnvironment(context).thisContext
- },
-
- ArrayExpression: function*(node: es.ArrayExpression, context: Context) {
- const res = []
- for (const n of node.elements as ContiguousArrayElements) {
- res.push(yield* evaluate(n, context))
- }
- return res
- },
-
- DebuggerStatement: function*(node: es.DebuggerStatement, context: Context) {
- context.runtime.break = true
- yield
- },
-
- FunctionExpression: function*(node: es.FunctionExpression, context: Context) {
- return new Closure(node, currentEnvironment(context), context)
- },
-
- ArrowFunctionExpression: function*(node: es.ArrowFunctionExpression, context: Context) {
- return Closure.makeFromArrowFunction(node, currentEnvironment(context), context)
- },
-
- Identifier: function*(node: es.Identifier, context: Context) {
- return getVariable(context, node.name)
- },
-
- CallExpression: function*(node: es.CallExpression, context: Context) {
- const callee = yield* actualValue(node.callee, context)
- const args = yield* getArgs(context, node)
- let thisContext
- if (node.callee.type === 'MemberExpression') {
- thisContext = yield* actualValue(node.callee.object, context)
- }
- const result = yield* apply(context, callee, args, node, thisContext)
- return result
- },
-
- NewExpression: function*(node: es.NewExpression, context: Context) {
- const callee = yield* evaluate(node.callee, context)
- const args = []
- for (const arg of node.arguments) {
- args.push(yield* evaluate(arg, context))
- }
- const obj: Value = {}
- if (callee instanceof Closure) {
- obj.__proto__ = callee.fun.prototype
- callee.fun.apply(obj, args)
- } else {
- obj.__proto__ = callee.prototype
- callee.apply(obj, args)
- }
- return obj
- },
-
- UnaryExpression: function*(node: es.UnaryExpression, context: Context) {
- const value = yield* actualValue(node.argument, context)
-
- const error = rttc.checkUnaryExpression(node, node.operator, value, context.chapter)
- if (error) {
- return handleRuntimeError(context, error)
- }
- return evaluateUnaryExpression(node.operator, value)
- },
-
- BinaryExpression: function*(node: es.BinaryExpression, context: Context) {
- const left = yield* actualValue(node.left, context)
- const right = yield* actualValue(node.right, context)
- const error = rttc.checkBinaryExpression(node, node.operator, context.chapter, left, right)
- if (error) {
- return handleRuntimeError(context, error)
- }
- return evaluateBinaryExpression(node.operator, left, right)
- },
-
- ConditionalExpression: function*(node: es.ConditionalExpression, context: Context) {
- return yield* this.IfStatement(node, context)
- },
-
- LogicalExpression: function*(node: es.LogicalExpression, context: Context) {
- return yield* this.ConditionalExpression(transformLogicalExpression(node), context)
- },
-
- VariableDeclaration: function*(node: es.VariableDeclaration, context: Context) {
- const declaration = node.declarations[0]
- const constant = node.kind === 'const'
- const id = declaration.id as es.Identifier
- const value = yield* evaluate(declaration.init!, context)
- defineVariable(context, id.name, value, constant)
- return undefined
- },
-
- ContinueStatement: function*(_node: es.ContinueStatement, _context: Context) {
- return new ContinueValue()
- },
-
- BreakStatement: function*(_node: es.BreakStatement, _context: Context) {
- return new BreakValue()
- },
-
- ForStatement: function*(node: es.ForStatement, context: Context) {
- // Create a new block scope for the loop variables
- const loopEnvironment = createBlockEnvironment(context, 'forLoopEnvironment')
- pushEnvironment(context, loopEnvironment)
-
- const initNode = node.init!
- const testNode = node.test!
- const updateNode = node.update!
- if (initNode.type === 'VariableDeclaration') {
- declareVariables(context, initNode)
- }
- yield* actualValue(initNode, context)
-
- let value
- while (yield* actualValue(testNode, context)) {
- // create block context and shallow copy loop environment head
- // see https://www.ecma-international.org/ecma-262/6.0/#sec-for-statement-runtime-semantics-labelledevaluation
- // and https://hacks.mozilla.org/2015/07/es6-in-depth-let-and-const/
- // We copy this as a const to avoid ES6 funkiness when mutating loop vars
- // https://github.com/source-academy/js-slang/issues/65#issuecomment-425618227
- const environment = createBlockEnvironment(context, 'forBlockEnvironment')
- pushEnvironment(context, environment)
- for (const name in loopEnvironment.head) {
- if (loopEnvironment.head.hasOwnProperty(name)) {
- declareIdentifier(context, name, node)
- defineVariable(context, name, loopEnvironment.head[name], true)
- }
- }
-
- value = yield* actualValue(node.body, context)
-
- // Remove block context
- popEnvironment(context)
- if (value instanceof ContinueValue) {
- value = undefined
- }
- if (value instanceof BreakValue) {
- value = undefined
- break
- }
- if (value instanceof ReturnValue || value instanceof TailCallReturnValue) {
- break
- }
-
- yield* actualValue(updateNode, context)
- }
-
- popEnvironment(context)
-
- return value
- },
-
- MemberExpression: function*(node: es.MemberExpression, context: Context) {
- let obj = yield* actualValue(node.object, context)
- if (obj instanceof Closure) {
- obj = obj.fun
- }
- let prop
- if (node.computed) {
- prop = yield* actualValue(node.property, context)
- } else {
- prop = (node.property as es.Identifier).name
- }
-
- const error = rttc.checkMemberAccess(node, obj, prop)
- if (error) {
- return handleRuntimeError(context, error)
- }
-
- if (
- obj !== null &&
- obj !== undefined &&
- typeof obj[prop] !== 'undefined' &&
- !obj.hasOwnProperty(prop)
- ) {
- return handleRuntimeError(context, new errors.GetInheritedPropertyError(node, obj, prop))
- }
- try {
- return obj[prop]
- } catch {
- return handleRuntimeError(context, new errors.GetPropertyError(node, obj, prop))
- }
- },
-
- AssignmentExpression: function*(node: es.AssignmentExpression, context: Context) {
- if (node.left.type === 'MemberExpression') {
- const left = node.left
- const obj = yield* actualValue(left.object, context)
- let prop
- if (left.computed) {
- prop = yield* actualValue(left.property, context)
- } else {
- prop = (left.property as es.Identifier).name
- }
-
- const error = rttc.checkMemberAccess(node, obj, prop)
- if (error) {
- return handleRuntimeError(context, error)
- }
-
- const val = yield* evaluate(node.right, context)
- try {
- obj[prop] = val
- } catch {
- return handleRuntimeError(context, new errors.SetPropertyError(node, obj, prop))
- }
- return val
- }
- const id = node.left as es.Identifier
- // Make sure it exist
- const value = yield* evaluate(node.right, context)
- setVariable(context, id.name, value)
- return value
- },
-
- FunctionDeclaration: function*(node: es.FunctionDeclaration, context: Context) {
- const id = node.id
- if (id === null) {
- throw new Error("Encountered a FunctionDeclaration node without an identifier. This should have been caught when parsing.")
- }
- // tslint:disable-next-line:no-any
- const closure = new Closure(node, currentEnvironment(context), context)
- defineVariable(context, id.name, closure, true)
- return undefined
- },
-
- IfStatement: function*(node: es.IfStatement | es.ConditionalExpression, context: Context) {
- const result = yield* reduceIf(node, context)
- if (result === null) {
- return undefined;
- }
- return yield* evaluate(result, context)
- },
-
- ExpressionStatement: function*(node: es.ExpressionStatement, context: Context) {
- return yield* evaluate(node.expression, context)
- },
-
- ReturnStatement: function*(node: es.ReturnStatement, context: Context) {
- let returnExpression = node.argument!
-
- // If we have a conditional expression, reduce it until we get something else
- while (
- returnExpression.type === 'LogicalExpression' ||
- returnExpression.type === 'ConditionalExpression'
- ) {
- if (returnExpression.type === 'LogicalExpression') {
- returnExpression = transformLogicalExpression(returnExpression)
- }
- returnExpression = yield* reduceIf(returnExpression, context)
- }
-
- // If we are now left with a CallExpression, then we use TCO
- if (returnExpression.type === 'CallExpression') {
- const callee = yield* actualValue(returnExpression.callee, context)
- const args = yield* getArgs(context, returnExpression)
- return new TailCallReturnValue(callee, args, returnExpression)
- } else {
- return new ReturnValue(yield* evaluate(returnExpression, context))
- }
- },
-
- WhileStatement: function*(node: es.WhileStatement, context: Context) {
- let value: any // tslint:disable-line
- while (
- // tslint:disable-next-line
- (yield* actualValue(node.test, context)) &&
- !(value instanceof ReturnValue) &&
- !(value instanceof BreakValue) &&
- !(value instanceof TailCallReturnValue)
- ) {
- value = yield* actualValue(node.body, context)
- }
- if (value instanceof BreakValue) {
- return undefined
- }
- return value
- },
-
- ObjectExpression: function*(node: es.ObjectExpression, context: Context) {
- const obj = {}
- for (const propUntyped of node.properties) {
- // node.properties: es.Property | es.SpreadExpression, but
- // our Acorn is set to ES6 which cannot have a es.SpreadExpression
- // at this point. Force the type.
- const prop = propUntyped as es.Property
- let key
- if (prop.key.type === 'Identifier') {
- key = prop.key.name
- } else {
- key = yield* evaluate(prop.key, context)
- }
- obj[key] = yield* evaluate(prop.value, context)
- }
- return obj
- },
-
- BlockStatement: function*(node: es.BlockStatement, context: Context) {
- // Create a new environment (block scoping)
- const environment = createBlockEnvironment(context, 'blockEnvironment')
- pushEnvironment(context, environment)
- const result: Value = yield* evaluateBlockStatement(context, node)
- popEnvironment(context)
- return result
- },
-
- ImportDeclaration: function*(node: es.ImportDeclaration, context: Context) {
- throw new Error('ImportDeclarations should already have been removed')
- },
-
- ExportNamedDeclaration: function*(_node: es.ExportNamedDeclaration, _context: Context) {
- // Exports are handled as a separate pre-processing step in 'transformImportedFile'.
- // Subsequently, they are removed from the AST by 'removeExports' before the AST is evaluated.
- // As such, there should be no ExportNamedDeclaration nodes in the AST.
- throw new Error('Encountered an ExportNamedDeclaration node in the AST while evaluating. This suggests that an invariant has been broken.')
- },
-
- ExportDefaultDeclaration: function*(_node: es.ExportDefaultDeclaration, _context: Context) {
- // Exports are handled as a separate pre-processing step in 'transformImportedFile'.
- // Subsequently, they are removed from the AST by 'removeExports' before the AST is evaluated.
- // As such, there should be no ExportDefaultDeclaration nodes in the AST.
- throw new Error('Encountered an ExportDefaultDeclaration node in the AST while evaluating. This suggests that an invariant has been broken.')
- },
-
- ExportAllDeclaration: function*(_node: es.ExportAllDeclaration, _context: Context) {
- // Exports are handled as a separate pre-processing step in 'transformImportedFile'.
- // Subsequently, they are removed from the AST by 'removeExports' before the AST is evaluated.
- // As such, there should be no ExportAllDeclaration nodes in the AST.
- throw new Error('Encountered an ExportAllDeclaration node in the AST while evaluating. This suggests that an invariant has been broken.')
- },
-
- Program: function*(node: es.BlockStatement, context: Context) {
- throw new Error('A program should not contain another program within itself')
- }
-}
-// tslint:enable:object-literal-shorthand
-
-// TODO: move to util
-/**
- * Checks if `env` is empty (that is, head of env is an empty object)
- */
-function isEmptyEnvironment(env: Environment) {
- return isEmpty(env.head)
-}
-
-/**
- * Extracts the non-empty tail environment from the given environment and
- * returns current environment if tail environment is a null.
- */
-function getNonEmptyEnv(environment: Environment): Environment {
- if (isEmptyEnvironment(environment)) {
- const tailEnvironment = environment.tail
- if (tailEnvironment === null) {
- return environment
- }
- return getNonEmptyEnv(tailEnvironment)
- } else {
- return environment
- }
-}
-
-export function* evaluateProgram(program: es.Program, context: Context) {
- yield* visit(context, program)
-
- context.numberOfOuterEnvironments += 1
- const environment = createBlockEnvironment(context, 'programEnvironment')
- pushEnvironment(context, environment)
-
- const otherNodes: es.Statement[] = []
-
- try {
- for (const node of program.body) {
- if (node.type !== 'ImportDeclaration') {
- otherNodes.push(node as es.Statement)
- continue
- }
-
- yield* visit(context, node)
-
- const moduleName = getModuleDeclarationSource(node)
- const functions = context.nativeStorage.loadedModules[moduleName]
-
- for (const spec of node.specifiers) {
- declareIdentifier(context, spec.local.name, node)
- let obj: any
-
- switch (spec.type) {
- case 'ImportSpecifier': {
- obj = functions[spec.imported.name]
- break
- }
- case 'ImportDefaultSpecifier': {
- obj = functions.default
- break
- }
- case 'ImportNamespaceSpecifier': {
- obj = functions
- break
- }
- }
-
- defineVariable(context, spec.local.name, obj, true)
- }
- yield* leave(context)
- }
- } catch (error) {
- handleRuntimeError(context, error)
- }
-
- const newProgram = create.blockStatement(otherNodes)
- const result = yield* forceIt(yield* evaluateBlockStatement(context, newProgram), context)
-
- yield* leave(context) // Done visiting program
-
- if (result instanceof Closure) {
- Object.defineProperty(getNonEmptyEnv(currentEnvironment(context)).head, uniqueId(context), {
- value: result,
- writable: false,
- enumerable: true
- })
- }
- return result
-}
-
-function* evaluate(node: Node, context: Context) {
- yield* visit(context, node)
- const result = yield* evaluators[node.type](node, context)
- yield* leave(context)
- if (result instanceof Closure) {
- Object.defineProperty(getNonEmptyEnv(currentEnvironment(context)).head, uniqueId(context), {
- value: result,
- writable: false,
- enumerable: true
- })
- }
- return result
-}
-
-export function* apply(
- context: Context,
- fun: Closure | Value,
- args: (Thunk | Value)[],
- node: es.CallExpression,
- thisContext?: Value
-) {
- let result: Value
- let total = 0
-
- while (!(result instanceof ReturnValue)) {
- if (fun instanceof Closure) {
- checkNumberOfArguments(context, fun, args, node!)
- const environment = createEnvironment(context, fun, args, node)
- if (result instanceof TailCallReturnValue) {
- replaceEnvironment(context, environment)
- } else {
- pushEnvironment(context, environment)
- total++
- }
- const bodyEnvironment = createBlockEnvironment(context, 'functionBodyEnvironment')
- bodyEnvironment.thisContext = thisContext
- pushEnvironment(context, bodyEnvironment)
- result = yield* evaluateBlockStatement(context, fun.node.body as es.BlockStatement)
- popEnvironment(context)
- if (result instanceof TailCallReturnValue) {
- fun = result.callee
- node = result.node
- args = result.args
- } else if (!(result instanceof ReturnValue)) {
- // No Return Value, set it as undefined
- result = new ReturnValue(undefined)
- }
- } else if (typeof fun === 'function') {
- checkNumberOfArguments(context, fun, args, node!)
- try {
- const forcedArgs = []
-
- for (const arg of args) {
- forcedArgs.push(yield* forceIt(arg, context))
- }
-
- result = fun.apply(thisContext, forcedArgs)
- break
- } catch (e) {
- // Recover from exception
- context.runtime.environments = context.runtime.environments.slice(
- -context.numberOfOuterEnvironments
- )
-
- const loc = node.loc ?? UNKNOWN_LOCATION
- if (!(e instanceof RuntimeSourceError || e instanceof errors.ExceptionError)) {
- // The error could've arisen when the builtin called a source function which errored.
- // If the cause was a source error, we don't want to include the error.
- // However if the error came from the builtin itself, we need to handle it.
- return handleRuntimeError(context, new errors.ExceptionError(e, loc))
- }
- result = undefined
- throw e
- }
- } else {
- return handleRuntimeError(context, new errors.CallingNonFunctionValue(fun, node))
- }
- }
- // Unwraps return value and release stack environment
- if (result instanceof ReturnValue) {
- result = result.value
- }
- for (let i = 1; i <= total; i++) {
- popEnvironment(context)
- }
- return result
-}
diff --git a/src/modules/loader/__tests__/loader.ts b/src/modules/loader/__tests__/loader.ts
index 3bc037315..6ad94fba0 100644
--- a/src/modules/loader/__tests__/loader.ts
+++ b/src/modules/loader/__tests__/loader.ts
@@ -1,9 +1,9 @@
-import { mockContext } from '../../../mocks/context'
+import { mockContext } from '../../../utils/testing/mocks'
import { Chapter, Variant } from '../../../types'
import { ModuleConnectionError, ModuleNotFoundError } from '../../errors'
import * as moduleLoader from '../loaders'
import type { ModuleDocumentation, ModuleManifest } from '../../moduleTypes'
-import { asMockedFunc } from '../../../utils/testing'
+import { asMockedFunc } from '../../../utils/testing/misc'
const moduleMocker = jest.fn()
global.fetch = jest.fn()
diff --git a/src/modules/loader/__tests__/requireProvider.ts b/src/modules/loader/__tests__/requireProvider.ts
index 3c787e9fd..91e5ad87e 100644
--- a/src/modules/loader/__tests__/requireProvider.ts
+++ b/src/modules/loader/__tests__/requireProvider.ts
@@ -1,4 +1,4 @@
-import { mockContext } from '../../../mocks/context'
+import { mockContext } from '../../../utils/testing/mocks'
import { Chapter } from '../../../types'
import { getRequireProvider } from '../requireProvider'
diff --git a/src/modules/preprocessor/__tests__/analyzer.ts b/src/modules/preprocessor/__tests__/analyzer.ts
index 522102dd3..80a41ebb8 100644
--- a/src/modules/preprocessor/__tests__/analyzer.ts
+++ b/src/modules/preprocessor/__tests__/analyzer.ts
@@ -11,7 +11,7 @@ import { stripIndent } from '../../../utils/formatters'
import parseProgramsAndConstructImportGraph from '../linker'
import analyzeImportsAndExports from '../analyzer'
import { parse } from '../../../parser/parser'
-import { mockContext } from '../../../mocks/context'
+import { mockContext } from '../../../utils/testing/mocks'
import loadSourceModules from '../../loader'
import type { SourceFiles as Files } from '../../moduleTypes'
import { objectKeys } from '../../../utils/misc'
diff --git a/src/modules/preprocessor/__tests__/linker.ts b/src/modules/preprocessor/__tests__/linker.ts
index 4de464c41..0572d94b8 100644
--- a/src/modules/preprocessor/__tests__/linker.ts
+++ b/src/modules/preprocessor/__tests__/linker.ts
@@ -1,4 +1,4 @@
-import { mockContext } from '../../../mocks/context'
+import { mockContext } from '../../../utils/testing/mocks'
import { MissingSemicolonError } from '../../../parser/errors'
import { Chapter, type Context } from '../../../types'
import { CircularImportError, ModuleNotFoundError } from '../../errors'
@@ -6,6 +6,7 @@ import type { SourceFiles } from '../../moduleTypes'
import parseProgramsAndConstructImportGraph from '../linker'
import * as resolver from '../resolver'
+import { expectTrue } from '../../../utils/testing/misc'
jest.spyOn(resolver, 'default')
beforeEach(() => {
@@ -130,13 +131,8 @@ test('Linker does tree-shaking', async () => {
'/a.js'
)
- // Wrap to appease typescript
- function expectWrapper(cond: boolean): asserts cond {
- expect(cond).toEqual(true)
- }
-
expect(errors.length).toEqual(0)
- expectWrapper(result.ok)
+ expectTrue(result.ok)
expect(resolver.default).not.toHaveBeenCalledWith('./b.js')
expect(Object.keys(result.programs)).not.toContain('/b.js')
})
diff --git a/src/modules/preprocessor/__tests__/preprocessor.ts b/src/modules/preprocessor/__tests__/preprocessor.ts
index 5f0baa0af..4c5c06d28 100644
--- a/src/modules/preprocessor/__tests__/preprocessor.ts
+++ b/src/modules/preprocessor/__tests__/preprocessor.ts
@@ -2,11 +2,11 @@ import type { Program } from 'estree'
import type { MockedFunction } from 'jest-mock'
import { parseError, type IOptions } from '../../..'
-import { mockContext } from '../../../mocks/context'
+import { mockContext } from '../../../utils/testing/mocks'
import { Chapter, type RecursivePartial } from '../../../types'
import { memoizedGetModuleDocsAsync } from '../../loader/loaders'
import preprocessFileImports from '..'
-import { sanitizeAST } from '../../../utils/ast/sanitizer'
+import { sanitizeAST } from '../../../utils/testing/sanitizer'
import { parse } from '../../../parser/parser'
import {
accessExportFunctionName,
diff --git a/src/modules/preprocessor/__tests__/transformers/hoistAndMergeImports.ts b/src/modules/preprocessor/__tests__/transformers/hoistAndMergeImports.ts
index 8bcc29aa8..1f8dbbb88 100644
--- a/src/modules/preprocessor/__tests__/transformers/hoistAndMergeImports.ts
+++ b/src/modules/preprocessor/__tests__/transformers/hoistAndMergeImports.ts
@@ -1,8 +1,8 @@
-import { mockContext } from '../../../../mocks/context'
+import { mockContext } from '../../../../utils/testing/mocks'
import { parse } from '../../../../parser/parser'
import { Chapter } from '../../../../types'
import hoistAndMergeImports from '../../transformers/hoistAndMergeImports'
-import { sanitizeAST } from '../../../../utils/ast/sanitizer'
+import { sanitizeAST } from '../../../../utils/testing/sanitizer'
describe('hoistAndMergeImports', () => {
const assertASTsAreEqual = (actualCode: string, expectedCode: string) => {
diff --git a/src/modules/preprocessor/__tests__/transformers/removeExports.ts b/src/modules/preprocessor/__tests__/transformers/removeExports.ts
index 8e45a5e0e..37f252101 100644
--- a/src/modules/preprocessor/__tests__/transformers/removeExports.ts
+++ b/src/modules/preprocessor/__tests__/transformers/removeExports.ts
@@ -1,8 +1,8 @@
-import { mockContext } from '../../../../mocks/context'
+import { mockContext } from '../../../../utils/testing/mocks'
import { parse } from '../../../../parser/parser'
import { Chapter, type Context } from '../../../../types'
import removeExports from '../../transformers/removeExports'
-import { sanitizeAST } from '../../../../utils/ast/sanitizer'
+import { sanitizeAST } from '../../../../utils/testing/sanitizer'
type TestCase = [description: string, inputCode: string, expectedCode: string]
diff --git a/src/modules/preprocessor/__tests__/transformers/transformProgramToFunctionDeclaration.ts b/src/modules/preprocessor/__tests__/transformers/transformProgramToFunctionDeclaration.ts
index 5cfb4625a..a5659651b 100644
--- a/src/modules/preprocessor/__tests__/transformers/transformProgramToFunctionDeclaration.ts
+++ b/src/modules/preprocessor/__tests__/transformers/transformProgramToFunctionDeclaration.ts
@@ -1,9 +1,9 @@
-import { mockContext } from '../../../../mocks/context'
+import { mockContext } from '../../../../utils/testing/mocks'
import { parse } from '../../../../parser/parser'
import { defaultExportLookupName } from '../../../../stdlib/localImport.prelude'
import { Chapter } from '../../../../types'
import { transformProgramToFunctionDeclaration } from '../../transformers/transformProgramToFunctionDeclaration'
-import { sanitizeAST } from '../../../../utils/ast/sanitizer'
+import { sanitizeAST } from '../../../../utils/testing/sanitizer'
describe('transformImportedFile', () => {
const currentFileName = '/dir/a.js'
diff --git a/src/name-extractor/__tests__/modules.ts b/src/name-extractor/__tests__/modules.ts
index b9c34da82..3337feb0c 100644
--- a/src/name-extractor/__tests__/modules.ts
+++ b/src/name-extractor/__tests__/modules.ts
@@ -1,13 +1,13 @@
import { DeclarationKind } from '..'
import { getNames } from '../..'
-import { mockContext } from '../../mocks/context'
+import { mockContext } from '../../utils/testing/mocks'
import { Chapter } from '../../types'
import {
memoizedGetModuleDocsAsync,
memoizedGetModuleManifestAsync
} from '../../modules/loader/loaders'
-import { asMockedFunc } from '../../utils/testing'
+import { asMockedFunc } from '../../utils/testing/misc'
import { ModuleConnectionError } from '../../modules/errors'
jest.mock('../../modules/loader/loaders')
diff --git a/src/parser/__tests__/__snapshots__/allowed-syntax.ts.snap b/src/parser/__tests__/__snapshots__/allowed-syntax.ts.snap
index 9f4b9ba4f..74cd75939 100644
--- a/src/parser/__tests__/__snapshots__/allowed-syntax.ts.snap
+++ b/src/parser/__tests__/__snapshots__/allowed-syntax.ts.snap
@@ -1,4633 +1,419399 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Syntaxes are allowed in the chapter they are introduced 0: parse passes 1`] = `
+exports[`Syntaxes are allowed in the chapter they are introduced 0 1`] = `
Object {
- "alertResult": Array [],
- "code": "parse(\\"\\");",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- "sequence",
- Array [
- null,
- null,
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": null,
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [],
+ "end": 0,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 0,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
],
- ],
- "resultStatus": "finished",
- "visualiseListResult": Array [],
-}
-`;
-
-exports[`Syntaxes are allowed in the chapter they are introduced 0: passes 1`] = `
-Object {
- "alertResult": Array [],
- "code": "",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": undefined,
- "resultStatus": "finished",
- "visualiseListResult": Array [],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": null,
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [],
+ "end": 0,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 0,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": undefined,
+ },
}
`;
-exports[`Syntaxes are allowed in the chapter they are introduced 1: parse passes 1`] = `
+exports[`Syntaxes are allowed in the chapter they are introduced 0 2`] = `
Object {
- "alertResult": Array [],
- "code": "parse(\\"function name(a, b) {\\\\n const sum = a + b;\\\\n if (sum > 1) {\\\\n return sum;\\\\n } else {\\\\n if (a % 2 === 0) {\\\\n return -1;\\\\n } else if (b % 2 === 0) {\\\\n return 1;\\\\n } else {\\\\n return a > b ? 0 : -2;\\\\n }\\\\n }\\\\n}\\\\nname(1, 2);\\");",
- "displayResult": Array [],
- "numErrors": 0,
- "parsedErrors": "",
- "result": Array [
- "sequence",
- Array [
- Array [
- Array [
- "function_declaration",
- Array [
- Array [
- "name",
- Array [
- "name",
- null,
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 10,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "",
+ },
],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
],
- Array [
- Array [
- Array [
- "name",
- Array [
- "a",
- null,
- ],
- ],
- Array [
- Array [
- "name",
- Array [
- "b",
- null,
- ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
],
- null,
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
],
- Array [
- Array [
- "block",
- Array [
- Array [
- "sequence",
- Array [
- Array [
- Array [
- "constant_declaration",
- Array [
- Array [
- "name",
- Array [
- "sum",
- null,
- ],
- ],
- Array [
- Array [
- "binary_operator_combination",
- Array [
- "+",
- Array [
- Array [
- "name",
- Array [
- "a",
- null,
- ],
- ],
- Array [
- Array [
- "name",
- Array [
- "b",
- null,
- ],
- ],
- null,
- ],
- ],
- ],
- ],
- null,
- ],
- ],
- ],
- Array [
- Array [
- "conditional_statement",
- Array [
- Array [
- "binary_operator_combination",
- Array [
- ">",
- Array [
- Array [
- "name",
- Array [
- "sum",
- null,
- ],
- ],
- Array [
- Array [
- "literal",
- Array [
- 1,
- null,
- ],
- ],
- null,
- ],
- ],
- ],
- ],
- Array [
- Array [
- "return_statement",
- Array [
- Array [
- "name",
- Array [
- "sum",
- null,
- ],
- ],
- null,
- ],
- ],
- Array [
- Array [
- "conditional_statement",
- Array [
- Array [
- "binary_operator_combination",
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 10,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ null,
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 1 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "name",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 41,
+ "id": Node {
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 2,
+ },
+ },
+ "name": "sum",
+ "start": 30,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 41,
+ "left": Node {
+ "end": 37,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 2,
+ },
+ },
+ "name": "a",
+ "start": 36,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 18,
+ "line": 2,
+ },
+ },
+ "name": "b",
+ "start": 40,
+ "type": "Identifier",
+ },
+ "start": 36,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 2,
+ },
+ },
+ "start": 30,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 42,
+ "kind": "const",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "start": 24,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "alternate": Node {
+ "body": Array [
+ Node {
+ "alternate": Node {
+ "alternate": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "alternate": Node {
+ "argument": Node {
+ "end": 213,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 26,
+ "line": 11,
+ },
+ },
+ "raw": "2",
+ "start": 212,
+ "type": "Literal",
+ "value": 2,
+ },
+ "end": 213,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 11,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 211,
+ "type": "UnaryExpression",
+ },
+ "consequent": Node {
+ "end": 208,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 11,
+ },
+ },
+ "raw": "0",
+ "start": 207,
+ "type": "Literal",
+ "value": 0,
+ },
+ "end": 213,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 11,
+ },
+ },
+ "start": 199,
+ "test": Node {
+ "end": 204,
+ "left": Node {
+ "end": 200,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 11,
+ },
+ },
+ "name": "a",
+ "start": 199,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 11,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 204,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 11,
+ },
+ },
+ "name": "b",
+ "start": 203,
+ "type": "Identifier",
+ },
+ "start": 199,
+ "type": "BinaryExpression",
+ },
+ "type": "ConditionalExpression",
+ },
+ "end": 214,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 11,
+ },
+ },
+ "start": 192,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 220,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 10,
+ },
+ },
+ "start": 184,
+ "type": "BlockStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 171,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 9,
+ },
+ },
+ "raw": "1",
+ "start": 170,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 172,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 9,
+ },
+ },
+ "start": 163,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 178,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 10,
+ },
+ "start": Position {
+ "column": 28,
+ "line": 8,
+ },
+ },
+ "start": 155,
+ "type": "BlockStatement",
+ },
+ "end": 220,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 8,
+ },
+ },
+ "start": 138,
+ "test": Node {
+ "end": 153,
+ "left": Node {
+ "end": 147,
+ "left": Node {
+ "end": 143,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "name": "b",
+ "start": 142,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "operator": "%",
+ "right": Node {
+ "end": 147,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 19,
+ "line": 8,
+ },
+ },
+ "raw": "2",
+ "start": 146,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 142,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "operator": "===",
+ "right": Node {
+ "end": 153,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 8,
+ },
+ },
+ "raw": "0",
+ "start": 152,
+ "type": "Literal",
+ "value": 0,
+ },
+ "start": 142,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "argument": Node {
+ "end": 125,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 7,
+ },
+ },
+ "raw": "1",
+ "start": 124,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 125,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 7,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 123,
+ "type": "UnaryExpression",
+ },
+ "end": 126,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "start": 116,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 132,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 6,
+ },
+ },
+ "start": 108,
+ "type": "BlockStatement",
+ },
+ "end": 220,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "start": 91,
+ "test": Node {
+ "end": 106,
+ "left": Node {
+ "end": 100,
+ "left": Node {
+ "end": 96,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "name": "a",
+ "start": 95,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "operator": "%",
+ "right": Node {
+ "end": 100,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 6,
+ },
+ },
+ "raw": "2",
+ "start": 99,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 95,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "operator": "===",
+ "right": Node {
+ "end": 106,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 18,
+ "line": 6,
+ },
+ },
+ "raw": "0",
+ "start": 105,
+ "type": "Literal",
+ "value": 0,
+ },
+ "start": 95,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 224,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 13,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 5,
+ },
+ },
+ "start": 85,
+ "type": "BlockStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 74,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 4,
+ },
+ },
+ "name": "sum",
+ "start": 71,
+ "type": "Identifier",
+ },
+ "end": 75,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "start": 64,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 79,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "start": 58,
+ "type": "BlockStatement",
+ },
+ "end": 224,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 13,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "start": 45,
+ "test": Node {
+ "end": 56,
+ "left": Node {
+ "end": 52,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "sum",
+ "start": 49,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 56,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 3,
+ },
+ },
+ "raw": "1",
+ "start": 55,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 49,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 226,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 14,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "start": 20,
+ "type": "BlockStatement",
+ },
+ "end": 226,
+ "expression": false,
+ "generator": false,
+ "id": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "name": "name",
+ "start": 9,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 14,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 14,
+ "type": "Identifier",
+ },
+ Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 17,
+ "type": "Identifier",
+ },
+ ],
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "FunctionDeclaration",
+ },
+ Node {
+ "end": 238,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 233,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 15,
+ },
+ },
+ "raw": "1",
+ "start": 232,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 236,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 15,
+ },
+ },
+ "raw": "2",
+ "start": 235,
+ "type": "Literal",
+ "value": 2,
+ },
+ ],
+ "callee": Node {
+ "end": 231,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 15,
+ },
+ },
+ "name": "name",
+ "start": 227,
+ "type": "Identifier",
+ },
+ "end": 237,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 15,
+ },
+ },
+ "start": 227,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 15,
+ },
+ },
+ "start": 227,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 238,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "function name(a, b) {
+ const sum = a + b;
+ if (sum > 1) {
+ return sum;
+ } else {
+ if (a % 2 === 0) {
+ return -1;
+ } else if (b % 2 === 0) {
+ return 1;
+ } else {
+ return a > b ? 0 : -2;
+ }
+ }
+}
+name(1, 2);",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "name",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 41,
+ "id": Node {
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 2,
+ },
+ },
+ "name": "sum",
+ "start": 30,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 41,
+ "left": Node {
+ "end": 37,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 2,
+ },
+ },
+ "name": "a",
+ "start": 36,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 18,
+ "line": 2,
+ },
+ },
+ "name": "b",
+ "start": 40,
+ "type": "Identifier",
+ },
+ "start": 36,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 2,
+ },
+ },
+ "start": 30,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 42,
+ "kind": "const",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "start": 24,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "alternate": Node {
+ "body": Array [
+ Node {
+ "alternate": Node {
+ "alternate": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "alternate": Node {
+ "argument": Node {
+ "end": 213,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 26,
+ "line": 11,
+ },
+ },
+ "raw": "2",
+ "start": 212,
+ "type": "Literal",
+ "value": 2,
+ },
+ "end": 213,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 11,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 211,
+ "type": "UnaryExpression",
+ },
+ "consequent": Node {
+ "end": 208,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 11,
+ },
+ },
+ "raw": "0",
+ "start": 207,
+ "type": "Literal",
+ "value": 0,
+ },
+ "end": 213,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 11,
+ },
+ },
+ "start": 199,
+ "test": Node {
+ "end": 204,
+ "left": Node {
+ "end": 200,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 11,
+ },
+ },
+ "name": "a",
+ "start": 199,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 11,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 204,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 11,
+ },
+ },
+ "name": "b",
+ "start": 203,
+ "type": "Identifier",
+ },
+ "start": 199,
+ "type": "BinaryExpression",
+ },
+ "type": "ConditionalExpression",
+ },
+ "end": 214,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 11,
+ },
+ },
+ "start": 192,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 220,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 10,
+ },
+ },
+ "start": 184,
+ "type": "BlockStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 171,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 9,
+ },
+ },
+ "raw": "1",
+ "start": 170,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 172,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 9,
+ },
+ },
+ "start": 163,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 178,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 10,
+ },
+ "start": Position {
+ "column": 28,
+ "line": 8,
+ },
+ },
+ "start": 155,
+ "type": "BlockStatement",
+ },
+ "end": 220,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 8,
+ },
+ },
+ "start": 138,
+ "test": Node {
+ "end": 153,
+ "left": Node {
+ "end": 147,
+ "left": Node {
+ "end": 143,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "name": "b",
+ "start": 142,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "operator": "%",
+ "right": Node {
+ "end": 147,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 19,
+ "line": 8,
+ },
+ },
+ "raw": "2",
+ "start": 146,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 142,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "operator": "===",
+ "right": Node {
+ "end": 153,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 8,
+ },
+ },
+ "raw": "0",
+ "start": 152,
+ "type": "Literal",
+ "value": 0,
+ },
+ "start": 142,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "argument": Node {
+ "end": 125,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 7,
+ },
+ },
+ "raw": "1",
+ "start": 124,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 125,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 7,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 123,
+ "type": "UnaryExpression",
+ },
+ "end": 126,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "start": 116,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 132,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 6,
+ },
+ },
+ "start": 108,
+ "type": "BlockStatement",
+ },
+ "end": 220,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "start": 91,
+ "test": Node {
+ "end": 106,
+ "left": Node {
+ "end": 100,
+ "left": Node {
+ "end": 96,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "name": "a",
+ "start": 95,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "operator": "%",
+ "right": Node {
+ "end": 100,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 6,
+ },
+ },
+ "raw": "2",
+ "start": 99,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 95,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "operator": "===",
+ "right": Node {
+ "end": 106,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 18,
+ "line": 6,
+ },
+ },
+ "raw": "0",
+ "start": 105,
+ "type": "Literal",
+ "value": 0,
+ },
+ "start": 95,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 224,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 13,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 5,
+ },
+ },
+ "start": 85,
+ "type": "BlockStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 74,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 4,
+ },
+ },
+ "name": "sum",
+ "start": 71,
+ "type": "Identifier",
+ },
+ "end": 75,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "start": 64,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 79,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "start": 58,
+ "type": "BlockStatement",
+ },
+ "end": 224,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 13,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "start": 45,
+ "test": Node {
+ "end": 56,
+ "left": Node {
+ "end": 52,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "sum",
+ "start": 49,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 56,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 3,
+ },
+ },
+ "raw": "1",
+ "start": 55,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 49,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 226,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 14,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "start": 20,
+ "type": "BlockStatement",
+ },
+ "end": 226,
+ "expression": false,
+ "generator": false,
+ "id": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "name": "name",
+ "start": 9,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 14,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 14,
+ "type": "Identifier",
+ },
+ Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 17,
+ "type": "Identifier",
+ },
+ ],
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "FunctionDeclaration",
+ },
+ Node {
+ "end": 238,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 233,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 15,
+ },
+ },
+ "raw": "1",
+ "start": 232,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 236,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 15,
+ },
+ },
+ "raw": "2",
+ "start": 235,
+ "type": "Literal",
+ "value": 2,
+ },
+ ],
+ "callee": Node {
+ "end": 231,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 15,
+ },
+ },
+ "name": "name",
+ "start": 227,
+ "type": "Identifier",
+ },
+ "end": 237,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 15,
+ },
+ },
+ "start": 227,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 15,
+ },
+ },
+ "start": 227,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 238,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 15,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "function name(a, b) {
+ const sum = a + b;
+ if (sum > 1) {
+ return sum;
+ } else {
+ if (a % 2 === 0) {
+ return -1;
+ } else if (b % 2 === 0) {
+ return 1;
+ } else {
+ return a > b ? 0 : -2;
+ }
+ }
+}
+name(1, 2);",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 3,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 1 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 262,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 260,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 260,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"function name(a, b) {\\\\n const sum = a + b;\\\\n if (sum > 1) {\\\\n return sum;\\\\n } else {\\\\n if (a % 2 === 0) {\\\\n return -1;\\\\n } else if (b % 2 === 0) {\\\\n return 1;\\\\n } else {\\\\n return a > b ? 0 : -2;\\\\n }\\\\n }\\\\n}\\\\nname(1, 2);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "function name(a, b) {
+ const sum = a + b;
+ if (sum > 1) {
+ return sum;
+ } else {
+ if (a % 2 === 0) {
+ return -1;
+ } else if (b % 2 === 0) {
+ return 1;
+ } else {
+ return a > b ? 0 : -2;
+ }
+ }
+}
+name(1, 2);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 261,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 261,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 262,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 262,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 262,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"function name(a, b) {\\\\n const sum = a + b;\\\\n if (sum > 1) {\\\\n return sum;\\\\n } else {\\\\n if (a % 2 === 0) {\\\\n return -1;\\\\n } else if (b % 2 === 0) {\\\\n return 1;\\\\n } else {\\\\n return a > b ? 0 : -2;\\\\n }\\\\n }\\\\n}\\\\nname(1, 2);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 262,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 260,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 260,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"function name(a, b) {\\\\n const sum = a + b;\\\\n if (sum > 1) {\\\\n return sum;\\\\n } else {\\\\n if (a % 2 === 0) {\\\\n return -1;\\\\n } else if (b % 2 === 0) {\\\\n return 1;\\\\n } else {\\\\n return a > b ? 0 : -2;\\\\n }\\\\n }\\\\n}\\\\nname(1, 2);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "function name(a, b) {
+ const sum = a + b;
+ if (sum > 1) {
+ return sum;
+ } else {
+ if (a % 2 === 0) {
+ return -1;
+ } else if (b % 2 === 0) {
+ return 1;
+ } else {
+ return a > b ? 0 : -2;
+ }
+ }
+}
+name(1, 2);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 261,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 261,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 262,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 262,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 262,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"function name(a, b) {\\\\n const sum = a + b;\\\\n if (sum > 1) {\\\\n return sum;\\\\n } else {\\\\n if (a % 2 === 0) {\\\\n return -1;\\\\n } else if (b % 2 === 0) {\\\\n return 1;\\\\n } else {\\\\n return a > b ? 0 : -2;\\\\n }\\\\n }\\\\n}\\\\nname(1, 2);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "function_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "name",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "name",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "b",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "block",
+ Array [
+ Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "constant_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "sum",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "+",
+ Array [
+ Array [
+ "name",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "b",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "conditional_statement",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ ">",
+ Array [
+ Array [
+ "name",
+ Array [
+ "sum",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "name",
+ Array [
+ "sum",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "conditional_statement",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "===",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "%",
+ Array [
+ Array [
+ "name",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 0,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "unary_operator_combination",
+ Array [
+ "-unary",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "conditional_statement",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "===",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "%",
+ Array [
+ Array [
+ "name",
+ Array [
+ "b",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 0,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "conditional_expression",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ ">",
+ Array [
+ Array [
+ "name",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "b",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 0,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "unary_operator_combination",
+ Array [
+ "-unary",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "application",
+ Array [
+ Array [
+ "name",
+ Array [
+ "name",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 2 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [],
+ "callee": Node {
+ "body": Node {
+ "end": 11,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "true",
+ "start": 7,
+ "type": "Literal",
+ "value": true,
+ },
+ "end": 11,
+ "expression": true,
+ "generator": false,
+ "id": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "params": Array [],
+ "start": 1,
+ "type": "ArrowFunctionExpression",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "(() => true)();",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [],
+ "callee": Node {
+ "body": Node {
+ "end": 11,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "true",
+ "start": 7,
+ "type": "Literal",
+ "value": true,
+ },
+ "end": 11,
+ "expression": true,
+ "generator": false,
+ "id": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "params": Array [],
+ "start": 1,
+ "type": "ArrowFunctionExpression",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "(() => true)();",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": true,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 2 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 25,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"(() => true)();\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "(() => true)();",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"(() => true)();\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 25,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"(() => true)();\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "(() => true)();",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"(() => true)();\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "application",
+ Array [
+ Array [
+ "lambda_expression",
+ Array [
+ null,
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "literal",
+ Array [
+ true,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ null,
+ null,
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 3 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 36,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 30,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 34,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 33,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 33,
+ "type": "Literal",
+ "value": 2,
+ },
+ ],
+ "callee": Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 25,
+ "left": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 24,
+ "line": 1,
+ },
+ },
+ "name": "y",
+ "start": 24,
+ "type": "Identifier",
+ },
+ "start": 20,
+ "type": "BinaryExpression",
+ },
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "start": 13,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "start": 11,
+ "type": "BlockStatement",
+ },
+ "end": 28,
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 2,
+ "type": "Identifier",
+ },
+ Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "name": "y",
+ "start": 5,
+ "type": "Identifier",
+ },
+ ],
+ "start": 1,
+ "type": "ArrowFunctionExpression",
+ },
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 35,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 36,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "((x, y) => { return x + y; })(1, 2);",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 36,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 30,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 34,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 33,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 33,
+ "type": "Literal",
+ "value": 2,
+ },
+ ],
+ "callee": Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 25,
+ "left": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 24,
+ "line": 1,
+ },
+ },
+ "name": "y",
+ "start": 24,
+ "type": "Identifier",
+ },
+ "start": 20,
+ "type": "BinaryExpression",
+ },
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "start": 13,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "start": 11,
+ "type": "BlockStatement",
+ },
+ "end": 28,
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 2,
+ "type": "Identifier",
+ },
+ Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "name": "y",
+ "start": 5,
+ "type": "Identifier",
+ },
+ ],
+ "start": 1,
+ "type": "ArrowFunctionExpression",
+ },
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 35,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 36,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "((x, y) => { return x + y; })(1, 2);",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 3,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 3 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 46,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 44,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"((x, y) => { return x + y; })(1, 2);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "((x, y) => { return x + y; })(1, 2);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 45,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 46,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 46,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 46,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"((x, y) => { return x + y; })(1, 2);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 46,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 44,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"((x, y) => { return x + y; })(1, 2);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "((x, y) => { return x + y; })(1, 2);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 45,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 46,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 46,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 46,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"((x, y) => { return x + y; })(1, 2);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "application",
+ Array [
+ Array [
+ "lambda_expression",
+ Array [
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "y",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "+",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "y",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 4 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 5,
+ "expression": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "true",
+ "start": 0,
+ "type": "Literal",
+ "value": true,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "true;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 5,
+ "expression": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "true",
+ "start": 0,
+ "type": "Literal",
+ "value": true,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "true;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": true,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 4 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"true;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "true;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"true;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"true;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "true;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"true;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "literal",
+ Array [
+ true,
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 5 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 6,
+ "expression": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "false",
+ "start": 0,
+ "type": "Literal",
+ "value": false,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "false;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 6,
+ "expression": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "false",
+ "start": 0,
+ "type": "Literal",
+ "value": false,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "false;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": false,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 5 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 16,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"false;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "false;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"false;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 16,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"false;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "false;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"false;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "literal",
+ Array [
+ false,
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 6 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "directive": "a string \\"\\" \\\\'\\\\'",
+ "end": 19,
+ "expression": Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "'a string \\"\\" \\\\'\\\\''",
+ "start": 0,
+ "type": "Literal",
+ "value": "a string \\"\\" ''",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "'a string \\"\\" \\\\'\\\\'';",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "directive": "a string \\"\\" \\\\'\\\\'",
+ "end": 19,
+ "expression": Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "'a string \\"\\" \\\\'\\\\''",
+ "start": 0,
+ "type": "Literal",
+ "value": "a string \\"\\" ''",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "'a string \\"\\" \\\\'\\\\'';",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": "a string \\"\\" ''",
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 6 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 33,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"'a string \\\\\\"\\\\\\" \\\\\\\\'\\\\\\\\'';\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "'a string \\"\\" \\\\'\\\\'';",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"'a string \\\\\\"\\\\\\" \\\\\\\\'\\\\\\\\'';\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 33,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"'a string \\\\\\"\\\\\\" \\\\\\\\'\\\\\\\\'';\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "'a string \\"\\" \\\\'\\\\'';",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"'a string \\\\\\"\\\\\\" \\\\\\\\'\\\\\\\\'';\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "literal",
+ Array [
+ "a string \\"\\" ''",
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 7 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 33,
+ "expression": Node {
+ "end": 32,
+ "left": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "31.4",
+ "start": 0,
+ "type": "Literal",
+ "value": 31.4,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 32,
+ "left": Node {
+ "end": 26,
+ "left": Node {
+ "end": 22,
+ "left": Node {
+ "argument": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "raw": "3.14e10",
+ "start": 9,
+ "type": "Literal",
+ "value": 31400000000,
+ },
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 8,
+ "type": "UnaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "operator": "*",
+ "right": Node {
+ "argument": Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 21,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 20,
+ "type": "UnaryExpression",
+ },
+ "start": 7,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "operator": "%",
+ "right": Node {
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 25,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 7,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "operator": "/",
+ "right": Node {
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 29,
+ "line": 1,
+ },
+ },
+ "raw": "1.5",
+ "start": 29,
+ "type": "Literal",
+ "value": 1.5,
+ },
+ "start": 7,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "31.4 + (-3.14e10) * -1 % 2 / 1.5;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 33,
+ "expression": Node {
+ "end": 32,
+ "left": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "31.4",
+ "start": 0,
+ "type": "Literal",
+ "value": 31.4,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 32,
+ "left": Node {
+ "end": 26,
+ "left": Node {
+ "end": 22,
+ "left": Node {
+ "argument": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "raw": "3.14e10",
+ "start": 9,
+ "type": "Literal",
+ "value": 31400000000,
+ },
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 8,
+ "type": "UnaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "operator": "*",
+ "right": Node {
+ "argument": Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 21,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "operator": "-",
+ "prefix": true,
+ "start": 20,
+ "type": "UnaryExpression",
+ },
+ "start": 7,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "operator": "%",
+ "right": Node {
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 25,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 7,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "operator": "/",
+ "right": Node {
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 29,
+ "line": 1,
+ },
+ },
+ "raw": "1.5",
+ "start": 29,
+ "type": "Literal",
+ "value": 1.5,
+ },
+ "start": 7,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "31.4 + (-3.14e10) * -1 % 2 / 1.5;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 31.4,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 7 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 43,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 41,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"31.4 + (-3.14e10) * -1 % 2 / 1.5;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "31.4 + (-3.14e10) * -1 % 2 / 1.5;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 43,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"31.4 + (-3.14e10) * -1 % 2 / 1.5;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 43,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 41,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"31.4 + (-3.14e10) * -1 % 2 / 1.5;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "31.4 + (-3.14e10) * -1 % 2 / 1.5;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 43,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"31.4 + (-3.14e10) * -1 % 2 / 1.5;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "binary_operator_combination",
+ Array [
+ "+",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 31.4,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "/",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "%",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "*",
+ Array [
+ Array [
+ "unary_operator_combination",
+ Array [
+ "-unary",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 31400000000,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "unary_operator_combination",
+ Array [
+ "-unary",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1.5,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 8 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 55,
+ "expression": Node {
+ "end": 54,
+ "left": Node {
+ "end": 45,
+ "left": Node {
+ "end": 36,
+ "left": Node {
+ "end": 26,
+ "left": Node {
+ "end": 16,
+ "left": Node {
+ "end": 7,
+ "left": Node {
+ "end": 1,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 0,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "===",
+ "right": Node {
+ "end": 7,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 6,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 0,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 16,
+ "left": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 11,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 15,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 11,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 26,
+ "left": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 20,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "operator": "<=",
+ "right": Node {
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 25,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 20,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 36,
+ "left": Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 30,
+ "type": "Literal",
+ "value": 2,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 1,
+ },
+ },
+ "operator": ">=",
+ "right": Node {
+ "end": 36,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 35,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 35,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 30,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 45,
+ "left": Node {
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 41,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 40,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 40,
+ "type": "Literal",
+ "value": 2,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 40,
+ "line": 1,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 45,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 44,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 44,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 40,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 54,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "||",
+ "right": Node {
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 54,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 49,
+ "line": 1,
+ },
+ },
+ "raw": "false",
+ "start": 49,
+ "type": "Literal",
+ "value": false,
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 55,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 55,
+ "expression": Node {
+ "end": 54,
+ "left": Node {
+ "end": 45,
+ "left": Node {
+ "end": 36,
+ "left": Node {
+ "end": 26,
+ "left": Node {
+ "end": 16,
+ "left": Node {
+ "end": 7,
+ "left": Node {
+ "end": 1,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 0,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "===",
+ "right": Node {
+ "end": 7,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 6,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 0,
+ "type": "BinaryExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 16,
+ "left": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 11,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 15,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 11,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 26,
+ "left": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 20,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "operator": "<=",
+ "right": Node {
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 25,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 25,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 20,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 36,
+ "left": Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 30,
+ "type": "Literal",
+ "value": 2,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 1,
+ },
+ },
+ "operator": ">=",
+ "right": Node {
+ "end": 36,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 36,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 35,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 35,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 30,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "&&",
+ "right": Node {
+ "end": 45,
+ "left": Node {
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 41,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 40,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 40,
+ "type": "Literal",
+ "value": 2,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 40,
+ "line": 1,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 45,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 45,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 44,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 44,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 40,
+ "type": "BinaryExpression",
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 54,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "operator": "||",
+ "right": Node {
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 54,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 49,
+ "line": 1,
+ },
+ },
+ "raw": "false",
+ "start": 49,
+ "type": "Literal",
+ "value": false,
+ },
+ "start": 0,
+ "type": "LogicalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 55,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": true,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 8 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 65,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 63,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 63,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 64,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 65,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 65,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 65,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 65,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 63,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 63,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 64,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 65,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 65,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 65,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"1 === 1 && 1 < 2 && 1 <= 2 && 2 >= 1 && 2 > 1 || false;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "logical_composition",
+ Array [
+ "||",
+ Array [
+ Array [
+ "logical_composition",
+ Array [
+ "&&",
+ Array [
+ Array [
+ "logical_composition",
+ Array [
+ "&&",
+ Array [
+ Array [
+ "logical_composition",
+ Array [
+ "&&",
+ Array [
+ Array [
+ "logical_composition",
+ Array [
+ "&&",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "===",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "<",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "<=",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ ">=",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ ">",
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ false,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 9 1`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 13,
+ "expression": Node {
+ "alternate": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ "consequent": Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 7,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "test": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "true",
+ "start": 0,
+ "type": "Literal",
+ "value": true,
+ },
+ "type": "ConditionalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "true ? 1 : 2;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 1,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {},
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 13,
+ "expression": Node {
+ "alternate": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ "consequent": Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 7,
+ "type": "Literal",
+ "value": 1,
+ },
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "test": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "true",
+ "start": 0,
+ "type": "Literal",
+ "value": true,
+ },
+ "type": "ConditionalExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_number": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ },
+ "typeAliasMap": Map {},
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "true ? 1 : 2;",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 1,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 9 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 23,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"true ? 1 : 2;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "true ? 1 : 2;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"true ? 1 : 2;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 23,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"true ? 1 : 2;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "true ? 1 : 2;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"true ? 1 : 2;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "conditional_expression",
+ Array [
+ Array [
+ "literal",
+ Array [
+ true,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 10 1`] = `"Line 1: null literals are not allowed."`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 10 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 5,
+ "expression": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "null",
+ "start": 0,
+ "type": "Literal",
+ "value": null,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "null;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 5,
+ "expression": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "raw": "null",
+ "start": 0,
+ "type": "Literal",
+ "value": null,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "null;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": null,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 10 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"null;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "null;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"null;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"null;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "null;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"null;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "literal",
+ Array [
+ null,
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 11 1`] = `"Line 1: null literals are not allowed."`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 11 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 14,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "null",
+ "start": 8,
+ "type": "Literal",
+ "value": null,
+ },
+ ],
+ "callee": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "pair",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "pair(1, null);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 14,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "null",
+ "start": 8,
+ "type": "Literal",
+ "value": null,
+ },
+ ],
+ "callee": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "pair",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "pair(1, null);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ 1,
+ null,
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 11 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 24,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"pair(1, null);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "pair(1, null);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"pair(1, null);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 24,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"pair(1, null);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "pair(1, null);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"pair(1, null);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "application",
+ Array [
+ Array [
+ "name",
+ Array [
+ "pair",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ null,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 12 1`] = `"Line 1: Name list not declared."`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 12 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 8,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ ],
+ "callee": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "list",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 7,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "list(1);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 8,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ ],
+ "callee": Node {
+ "end": 4,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "list",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 7,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "list(1);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ 1,
+ null,
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 12 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 18,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"list(1);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "list(1);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"list(1);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 18,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"list(1);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "list(1);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"list(1);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "application",
+ Array [
+ Array [
+ "name",
+ Array [
+ "list",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ null,
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 13 1`] = `"Line 1: Export named declarations are not allowed"`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 13 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "f",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 32,
+ "type": "Identifier",
+ },
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "start": 25,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 36,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 1,
+ },
+ },
+ "start": 21,
+ "type": "BlockStatement",
+ },
+ "end": 36,
+ "expression": false,
+ "generator": false,
+ "id": Node {
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 1,
+ },
+ },
+ "name": "f",
+ "start": 16,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 18,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 18,
+ "type": "Identifier",
+ },
+ ],
+ "start": 7,
+ "typability": "NotYetTyped",
+ "type": "FunctionDeclaration",
+ },
+ Node {
+ "end": 42,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 40,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 4,
+ },
+ },
+ "raw": "5",
+ "start": 39,
+ "type": "Literal",
+ "value": 5,
+ },
+ ],
+ "callee": Node {
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "f",
+ "start": 37,
+ "type": "Identifier",
+ },
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 37,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 37,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "export function f(x) {
+ return x;
+}
+f(5);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "f",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 32,
+ "type": "Identifier",
+ },
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "start": 25,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 36,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 21,
+ "line": 1,
+ },
+ },
+ "start": 21,
+ "type": "BlockStatement",
+ },
+ "end": 36,
+ "expression": false,
+ "generator": false,
+ "id": Node {
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 1,
+ },
+ },
+ "name": "f",
+ "start": 16,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 18,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 18,
+ "type": "Identifier",
+ },
+ ],
+ "start": 7,
+ "typability": "NotYetTyped",
+ "type": "FunctionDeclaration",
+ },
+ Node {
+ "end": 42,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 40,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 4,
+ },
+ },
+ "raw": "5",
+ "start": 39,
+ "type": "Literal",
+ "value": 5,
+ },
+ ],
+ "callee": Node {
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "f",
+ "start": 37,
+ "type": "Identifier",
+ },
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 37,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 37,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "export function f(x) {
+ return x;
+}
+f(5);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 5,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 13 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 55,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 53,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 53,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"export function f(x) {\\\\n return x;\\\\n}\\\\nf(5);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "export function f(x) {
+ return x;
+}
+f(5);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 54,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 55,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"export function f(x) {\\\\n return x;\\\\n}\\\\nf(5);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 55,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 53,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 53,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"export function f(x) {\\\\n return x;\\\\n}\\\\nf(5);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "export function f(x) {
+ return x;
+}
+f(5);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 54,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 55,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 55,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"export function f(x) {\\\\n return x;\\\\n}\\\\nf(5);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "export_named_declaration",
+ Array [
+ Array [
+ "function_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "f",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ null,
+ ],
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "application",
+ Array [
+ Array [
+ "name",
+ Array [
+ "f",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 5,
+ null,
+ ],
+ ],
+ null,
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 14 1`] = `"Line 1: Export named declarations are not allowed"`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 14 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "x",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 18,
+ "id": Node {
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 13,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 17,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "start": 13,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 19,
+ "kind": "const",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "start": 7,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 22,
+ "expression": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 20,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "export const x = 1;
+x;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 2,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "x",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 18,
+ "id": Node {
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 13,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 17,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "start": 13,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 19,
+ "kind": "const",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "start": 7,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 22,
+ "expression": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 20,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "export const x = 1;
+x;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 1,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 14 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 33,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"export const x = 1;\\\\nx;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "export const x = 1;
+x;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"export const x = 1;\\\\nx;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 33,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 31,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"export const x = 1;\\\\nx;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "export const x = 1;
+x;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"export const x = 1;\\\\nx;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "export_named_declaration",
+ Array [
+ Array [
+ "constant_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 15 1`] = `
+"Line 1: Mutable variable declaration using keyword 'let' is not allowed.
+Line 3: Assignment expressions are not allowed
+Line 2: While statements are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 15 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "i",
+ "startTime",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "i",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 8,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "end": 39,
+ "expression": Node {
+ "end": 38,
+ "left": Node {
+ "end": 30,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "name": "i",
+ "start": 29,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 38,
+ "left": Node {
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "i",
+ "start": 33,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 3,
+ },
+ },
+ "raw": "1",
+ "start": 37,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 33,
+ "type": "BinaryExpression",
+ },
+ "start": 29,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "start": 29,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 2,
+ },
+ },
+ "start": 25,
+ "type": "BlockStatement",
+ },
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "test": Node {
+ "end": 23,
+ "left": Node {
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 18,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 2,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 2,
+ },
+ },
+ "raw": "5",
+ "start": 22,
+ "type": "Literal",
+ "value": 5,
+ },
+ "start": 18,
+ "type": "BinaryExpression",
+ },
+ "type": "WhileStatement",
+ },
+ Node {
+ "end": 44,
+ "expression": Node {
+ "end": 43,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "name": "i",
+ "start": 42,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "start": 42,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let i = 1;
+while (i < 5) {
+ i = i + 1;
+}
+i;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "i",
+ "startTime",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "i",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 8,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "end": 39,
+ "expression": Node {
+ "end": 38,
+ "left": Node {
+ "end": 30,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "name": "i",
+ "start": 29,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 38,
+ "left": Node {
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "i",
+ "start": 33,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 3,
+ },
+ },
+ "raw": "1",
+ "start": 37,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 33,
+ "type": "BinaryExpression",
+ },
+ "start": 29,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "start": 29,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 2,
+ },
+ },
+ "start": 25,
+ "type": "BlockStatement",
+ },
+ "end": 41,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "test": Node {
+ "end": 23,
+ "left": Node {
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 18,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 2,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 2,
+ },
+ },
+ "raw": "5",
+ "start": 22,
+ "type": "Literal",
+ "value": 5,
+ },
+ "start": 18,
+ "type": "BinaryExpression",
+ },
+ "type": "WhileStatement",
+ },
+ Node {
+ "end": 44,
+ "expression": Node {
+ "end": 43,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "name": "i",
+ "start": 42,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "start": 42,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let i = 1;
+while (i < 5) {
+ i = i + 1;
+}
+i;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 5,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 15 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 58,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 56,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 56,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let i = 1;\\\\nwhile (i < 5) {\\\\n i = i + 1;\\\\n}\\\\ni;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let i = 1;
+while (i < 5) {
+ i = i + 1;
+}
+i;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 57,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 57,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 58,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 58,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 58,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let i = 1;\\\\nwhile (i < 5) {\\\\n i = i + 1;\\\\n}\\\\ni;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 58,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 56,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 56,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let i = 1;\\\\nwhile (i < 5) {\\\\n i = i + 1;\\\\n}\\\\ni;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let i = 1;
+while (i < 5) {
+ i = i + 1;
+}
+i;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 57,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 57,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 58,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 58,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 58,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let i = 1;\\\\nwhile (i < 5) {\\\\n i = i + 1;\\\\n}\\\\ni;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "while_loop",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "<",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 5,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "+",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 16 1`] = `
+"Line 1: Mutable variable declaration using keyword 'let' is not allowed.
+Line 2: Assignment expressions are not allowed
+Line 2: Assignment expressions are not allowed
+Line 2: For statements are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 16 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "i",
+ "startTime",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "i",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 8,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "body": Node {
+ "body": Array [],
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 2,
+ },
+ },
+ "start": 41,
+ "type": "BlockStatement",
+ },
+ "end": 44,
+ "init": Node {
+ "end": 21,
+ "left": Node {
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 16,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 20,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 16,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "test": Node {
+ "end": 28,
+ "left": Node {
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 23,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 2,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 2,
+ },
+ },
+ "raw": "5",
+ "start": 27,
+ "type": "Literal",
+ "value": 5,
+ },
+ "start": 23,
+ "type": "BinaryExpression",
+ },
+ "type": "ForStatement",
+ "update": Node {
+ "end": 39,
+ "left": Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 19,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 30,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 19,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 39,
+ "left": Node {
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 34,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 27,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 38,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 34,
+ "type": "BinaryExpression",
+ },
+ "start": 30,
+ "type": "AssignmentExpression",
+ },
+ },
+ Node {
+ "end": 47,
+ "expression": Node {
+ "end": 46,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "i",
+ "start": 45,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 45,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 47,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let i = 1;
+for (i = 1; i < 5; i = i + 1) {
+}
+i;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "i",
+ "startTime",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "i",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 8,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "body": Node {
+ "body": Array [],
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 30,
+ "line": 2,
+ },
+ },
+ "start": 41,
+ "type": "BlockStatement",
+ },
+ "end": 44,
+ "init": Node {
+ "end": 21,
+ "left": Node {
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 16,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 20,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 16,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "test": Node {
+ "end": 28,
+ "left": Node {
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 23,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 2,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 2,
+ },
+ },
+ "raw": "5",
+ "start": 27,
+ "type": "Literal",
+ "value": 5,
+ },
+ "start": 23,
+ "type": "BinaryExpression",
+ },
+ "type": "ForStatement",
+ "update": Node {
+ "end": 39,
+ "left": Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 19,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 30,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 19,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 39,
+ "left": Node {
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "name": "i",
+ "start": 34,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 27,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 38,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 34,
+ "type": "BinaryExpression",
+ },
+ "start": 30,
+ "type": "AssignmentExpression",
+ },
+ },
+ Node {
+ "end": 47,
+ "expression": Node {
+ "end": 46,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "i",
+ "start": 45,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 45,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 47,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let i = 1;
+for (i = 1; i < 5; i = i + 1) {
+}
+i;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 5,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 16 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 60,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 58,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 58,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let i = 1;\\\\nfor (i = 1; i < 5; i = i + 1) {\\\\n}\\\\ni;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let i = 1;
+for (i = 1; i < 5; i = i + 1) {
+}
+i;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 59,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 59,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 60,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 60,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 60,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let i = 1;\\\\nfor (i = 1; i < 5; i = i + 1) {\\\\n}\\\\ni;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 60,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 58,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 58,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let i = 1;\\\\nfor (i = 1; i < 5; i = i + 1) {\\\\n}\\\\ni;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let i = 1;
+for (i = 1; i < 5; i = i + 1) {
+}
+i;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 59,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 59,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 60,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 60,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 60,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let i = 1;\\\\nfor (i = 1; i < 5; i = i + 1) {\\\\n}\\\\ni;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "for_loop",
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "<",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 5,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "+",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "sequence",
+ Array [
+ null,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 17 1`] = `
+"Line 1: Mutable variable declaration using keyword 'let' is not allowed.
+Line 2: Mutable variable declaration using keyword 'let' is not allowed.
+Line 2: Assignment expressions are not allowed
+Line 4: Continue statements are not allowed
+Line 6: Assignment expressions are not allowed
+Line 8: Break statements are not allowed
+Line 7: Missing \\"else\\" in \\"if-else\\" statement.
+Line 2: For statements are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 17 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "i",
+ "startTime",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "i",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 8,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "alternate": Node {
+ "body": Array [
+ Node {
+ "end": 101,
+ "expression": Node {
+ "end": 100,
+ "left": Node {
+ "end": 92,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "name": "i",
+ "start": 91,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 100,
+ "left": Node {
+ "end": 96,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "name": "i",
+ "start": 95,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 100,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 6,
+ },
+ },
+ "raw": "1",
+ "start": 99,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 95,
+ "type": "BinaryExpression",
+ },
+ "start": 91,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "start": 91,
+ "type": "ExpressionStatement",
+ },
+ Node {
+ "alternate": null,
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "end": 131,
+ "label": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 8,
+ },
+ },
+ "start": 125,
+ "type": "BreakStatement",
+ },
+ ],
+ "end": 137,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 7,
+ },
+ },
+ "start": 117,
+ "type": "BlockStatement",
+ },
+ "end": 137,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 7,
+ },
+ },
+ "start": 106,
+ "test": Node {
+ "end": 115,
+ "left": Node {
+ "end": 111,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 7,
+ },
+ },
+ "name": "j",
+ "start": 110,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 7,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 115,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 7,
+ },
+ },
+ "raw": "2",
+ "start": 114,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 110,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 141,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 10,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 5,
+ },
+ },
+ "start": 85,
+ "type": "BlockStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "end": 75,
+ "label": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "start": 66,
+ "type": "ContinueStatement",
+ },
+ ],
+ "end": 79,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 3,
+ },
+ },
+ "start": 60,
+ "type": "BlockStatement",
+ },
+ "end": 141,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 10,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "start": 49,
+ "test": Node {
+ "end": 58,
+ "left": Node {
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "j",
+ "start": 53,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 58,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 3,
+ },
+ },
+ "raw": "1",
+ "start": 57,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 53,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 143,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 34,
+ "line": 2,
+ },
+ },
+ "start": 45,
+ "type": "BlockStatement",
+ },
+ "end": 143,
+ "init": Node {
+ "declarations": Array [
+ Node {
+ "end": 25,
+ "id": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 2,
+ },
+ },
+ "raw": "0",
+ "start": 24,
+ "type": "Literal",
+ "value": 0,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "start": 20,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 25,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 2,
+ },
+ },
+ "start": 16,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "test": Node {
+ "end": 32,
+ "left": Node {
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 27,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 2,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 2,
+ },
+ },
+ "raw": "5",
+ "start": 31,
+ "type": "Literal",
+ "value": 5,
+ },
+ "start": 27,
+ "type": "BinaryExpression",
+ },
+ "type": "ForStatement",
+ "update": Node {
+ "end": 43,
+ "left": Node {
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 34,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 43,
+ "left": Node {
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 27,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 38,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 27,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 43,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 31,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 42,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 38,
+ "type": "BinaryExpression",
+ },
+ "start": 34,
+ "type": "AssignmentExpression",
+ },
+ },
+ Node {
+ "end": 146,
+ "expression": Node {
+ "end": 145,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 12,
+ },
+ },
+ "name": "i",
+ "start": 144,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 12,
+ },
+ },
+ "start": 144,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 146,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let i = 1;
+for (let j = 0; j < 5; j = j + 1) {
+ if (j < 1) {
+ continue;
+ } else {
+ i = i + 1;
+ if (j > 2) {
+ break;
+ }
+ }
+}
+i;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "i",
+ "startTime",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "i",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 8,
+ "type": "Literal",
+ "value": 1,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "alternate": Node {
+ "body": Array [
+ Node {
+ "end": 101,
+ "expression": Node {
+ "end": 100,
+ "left": Node {
+ "end": 92,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "name": "i",
+ "start": 91,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 100,
+ "left": Node {
+ "end": 96,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "name": "i",
+ "start": 95,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 6,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 100,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 6,
+ },
+ },
+ "raw": "1",
+ "start": 99,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 95,
+ "type": "BinaryExpression",
+ },
+ "start": 91,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 6,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "start": 91,
+ "type": "ExpressionStatement",
+ },
+ Node {
+ "alternate": null,
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "end": 131,
+ "label": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 8,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 8,
+ },
+ },
+ "start": 125,
+ "type": "BreakStatement",
+ },
+ ],
+ "end": 137,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 7,
+ },
+ },
+ "start": 117,
+ "type": "BlockStatement",
+ },
+ "end": 137,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 9,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 7,
+ },
+ },
+ "start": 106,
+ "test": Node {
+ "end": 115,
+ "left": Node {
+ "end": 111,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 7,
+ },
+ },
+ "name": "j",
+ "start": 110,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 7,
+ },
+ },
+ "operator": ">",
+ "right": Node {
+ "end": 115,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 7,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 7,
+ },
+ },
+ "raw": "2",
+ "start": 114,
+ "type": "Literal",
+ "value": 2,
+ },
+ "start": 110,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 141,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 10,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 5,
+ },
+ },
+ "start": 85,
+ "type": "BlockStatement",
+ },
+ "consequent": Node {
+ "body": Array [
+ Node {
+ "end": 75,
+ "label": null,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "start": 66,
+ "type": "ContinueStatement",
+ },
+ ],
+ "end": 79,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 3,
+ },
+ },
+ "start": 60,
+ "type": "BlockStatement",
+ },
+ "end": 141,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 10,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 3,
+ },
+ },
+ "start": 49,
+ "test": Node {
+ "end": 58,
+ "left": Node {
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "j",
+ "start": 53,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 58,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 3,
+ },
+ },
+ "raw": "1",
+ "start": 57,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 53,
+ "type": "BinaryExpression",
+ },
+ "type": "IfStatement",
+ },
+ ],
+ "end": 143,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 34,
+ "line": 2,
+ },
+ },
+ "start": 45,
+ "type": "BlockStatement",
+ },
+ "end": 143,
+ "init": Node {
+ "declarations": Array [
+ Node {
+ "end": 25,
+ "id": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 2,
+ },
+ },
+ "raw": "0",
+ "start": 24,
+ "type": "Literal",
+ "value": 0,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "start": 20,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 25,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 2,
+ },
+ },
+ "start": 16,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 11,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "test": Node {
+ "end": 32,
+ "left": Node {
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 27,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 16,
+ "line": 2,
+ },
+ },
+ "operator": "<",
+ "right": Node {
+ "end": 32,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 2,
+ },
+ },
+ "raw": "5",
+ "start": 31,
+ "type": "Literal",
+ "value": 5,
+ },
+ "start": 27,
+ "type": "BinaryExpression",
+ },
+ "type": "ForStatement",
+ "update": Node {
+ "end": 43,
+ "left": Node {
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 34,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 43,
+ "left": Node {
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 27,
+ "line": 2,
+ },
+ },
+ "name": "j",
+ "start": 38,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 27,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 43,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 32,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 31,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 42,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 38,
+ "type": "BinaryExpression",
+ },
+ "start": 34,
+ "type": "AssignmentExpression",
+ },
+ },
+ Node {
+ "end": 146,
+ "expression": Node {
+ "end": 145,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 12,
+ },
+ },
+ "name": "i",
+ "start": 144,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 12,
+ },
+ },
+ "start": 144,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 146,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 12,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let i = 1;
+for (let j = 0; j < 5; j = j + 1) {
+ if (j < 1) {
+ continue;
+ } else {
+ i = i + 1;
+ if (j > 2) {
+ break;
+ }
+ }
+}
+i;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 4,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 17 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 167,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 165,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 165,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let i = 1;\\\\nfor (let j = 0; j < 5; j = j + 1) {\\\\n if (j < 1) {\\\\n continue;\\\\n } else {\\\\n i = i + 1;\\\\n if (j > 2) {\\\\n break;\\\\n }\\\\n }\\\\n}\\\\ni;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let i = 1;
+for (let j = 0; j < 5; j = j + 1) {
+ if (j < 1) {
+ continue;
+ } else {
+ i = i + 1;
+ if (j > 2) {
+ break;
+ }
+ }
+}
+i;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 166,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 166,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 167,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 167,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 167,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let i = 1;\\\\nfor (let j = 0; j < 5; j = j + 1) {\\\\n if (j < 1) {\\\\n continue;\\\\n } else {\\\\n i = i + 1;\\\\n if (j > 2) {\\\\n break;\\\\n }\\\\n }\\\\n}\\\\ni;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 167,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 165,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 165,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let i = 1;\\\\nfor (let j = 0; j < 5; j = j + 1) {\\\\n if (j < 1) {\\\\n continue;\\\\n } else {\\\\n i = i + 1;\\\\n if (j > 2) {\\\\n break;\\\\n }\\\\n }\\\\n}\\\\ni;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let i = 1;
+for (let j = 0; j < 5; j = j + 1) {
+ if (j < 1) {
+ continue;
+ } else {
+ i = i + 1;
+ if (j > 2) {
+ break;
+ }
+ }
+}
+i;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 166,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 166,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 167,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 167,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 167,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let i = 1;\\\\nfor (let j = 0; j < 5; j = j + 1) {\\\\n if (j < 1) {\\\\n continue;\\\\n } else {\\\\n i = i + 1;\\\\n if (j > 2) {\\\\n break;\\\\n }\\\\n }\\\\n}\\\\ni;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "for_loop",
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "j",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 0,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "<",
+ Array [
+ Array [
+ "name",
+ Array [
+ "j",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 5,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
+ Array [
+ "j",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "+",
+ Array [
+ Array [
+ "name",
+ Array [
+ "j",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "conditional_statement",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "<",
+ Array [
+ Array [
+ "name",
+ Array [
+ "j",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "continue_statement",
+ null,
+ ],
+ Array [
+ Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
Array [
- "===",
+ "i",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "binary_operator_combination",
Array [
- Array [
- "binary_operator_combination",
- Array [
- "%",
- Array [
- Array [
- "name",
- Array [
- "a",
- null,
- ],
- ],
- Array [
- Array [
- "literal",
- Array [
- 2,
- null,
- ],
- ],
- null,
- ],
- ],
- ],
- ],
+ "+",
Array [
Array [
- "literal",
+ "name",
Array [
- 0,
+ "i",
null,
],
],
- null,
- ],
- ],
- ],
- ],
- Array [
- Array [
- "return_statement",
- Array [
- Array [
- "unary_operator_combination",
Array [
- "-unary",
Array [
+ "literal",
Array [
- "literal",
- Array [
- 1,
- null,
- ],
+ 1,
+ null,
],
- null,
],
+ null,
],
],
- null,
],
],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "conditional_statement",
+ Array [
Array [
+ "binary_operator_combination",
Array [
- "conditional_statement",
+ ">",
Array [
Array [
- "binary_operator_combination",
- Array [
- "===",
- Array [
- Array [
- "binary_operator_combination",
- Array [
- "%",
- Array [
- Array [
- "name",
- Array [
- "b",
- null,
- ],
- ],
- Array [
- Array [
- "literal",
- Array [
- 2,
- null,
- ],
- ],
- null,
- ],
- ],
- ],
- ],
- Array [
- Array [
- "literal",
- Array [
- 0,
- null,
- ],
- ],
- null,
- ],
- ],
+ "name",
+ Array [
+ "j",
+ null,
],
],
Array [
Array [
- "return_statement",
+ "literal",
Array [
- Array [
- "literal",
- Array [
- 1,
- null,
- ],
- ],
+ 2,
null,
],
],
- Array [
- Array [
- "return_statement",
- Array [
- Array [
- "conditional_expression",
- Array [
- Array [
- "binary_operator_combination",
- Array [
- ">",
- Array [
- Array [
- "name",
- Array [
- "a",
- null,
- ],
- ],
- Array [
- Array [
- "name",
- Array [
- "b",
- null,
- ],
- ],
- null,
- ],
- ],
- ],
- ],
- Array [
- Array [
- "literal",
- Array [
- 0,
- null,
- ],
- ],
- Array [
- Array [
- "unary_operator_combination",
- Array [
- "-unary",
- Array [
- Array [
- "literal",
- Array [
- 2,
- null,
- ],
- ],
- null,
- ],
- ],
- ],
- null,
- ],
- ],
- ],
- ],
- null,
- ],
- ],
- null,
- ],
+ null,
],
],
],
- null,
+ ],
+ Array [
+ Array [
+ "break_statement",
+ null,
+ ],
+ Array [
+ Array [
+ "sequence",
+ Array [
+ null,
+ null,
+ ],
+ ],
+ null,
+ ],
],
],
],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "i",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 18 1`] = `"Line 1: Array expressions are not allowed"`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 18 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 3,
+ "expression": Node {
+ "elements": Array [],
+ "end": 2,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "[];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 3,
+ "expression": Node {
+ "elements": Array [],
+ "end": 2,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "[];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 18 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 13,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 11,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"[];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "[];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"[];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 13,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 11,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"[];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "[];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"[];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "array_expression",
+ Array [
+ null,
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 19 1`] = `"Line 1: Array expressions are not allowed"`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 19 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 10,
+ "expression": Node {
+ "elements": Array [
+ Node {
+ "end": 2,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 1,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 4,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 7,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "[1, 2, 3];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 10,
+ "expression": Node {
+ "elements": Array [
+ Node {
+ "end": 2,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 1,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 4,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 7,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "[1, 2, 3];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ 1,
+ 2,
+ 3,
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 19 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 20,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"[1, 2, 3];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "[1, 2, 3];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"[1, 2, 3];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 20,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"[1, 2, 3];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "[1, 2, 3];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"[1, 2, 3];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "array_expression",
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 3,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 20 1`] = `
+"Line 1: Array expressions are not allowed
+Line 1: Member expressions are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 20 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 13,
+ "expression": Node {
+ "computed": true,
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "elements": Array [
+ Node {
+ "end": 2,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 1,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 4,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 7,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ArrayExpression",
+ },
+ "property": Node {
+ "end": 11,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 10,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 0,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "[1, 2, 3][1];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 13,
+ "expression": Node {
+ "computed": true,
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "elements": Array [
+ Node {
+ "end": 2,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 1,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 4,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 7,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ArrayExpression",
+ },
+ "property": Node {
+ "end": 11,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 10,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 0,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "[1, 2, 3][1];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 2,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 20 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 23,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"[1, 2, 3][1];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "[1, 2, 3][1];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"[1, 2, 3][1];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 23,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"[1, 2, 3][1];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "[1, 2, 3][1];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 22,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"[1, 2, 3][1];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "object_access",
+ Array [
+ Array [
+ "array_expression",
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 3,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 21 1`] = `
+"Line 1: Array expressions are not allowed
+Line 1: Mutable variable declaration using keyword 'let' is not allowed.
+Line 2: Member expressions are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 21 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "x",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 17,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "elements": Array [
+ Node {
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 9,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 12,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 15,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "start": 8,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 18,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 24,
+ "expression": Node {
+ "computed": true,
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "object": Node {
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 19,
+ "type": "Identifier",
+ },
+ "property": Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 21,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 19,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 19,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let x = [1, 2, 3];
+x[1];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "x",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 17,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "elements": Array [
+ Node {
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 9,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 12,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 15,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "start": 8,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 18,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 24,
+ "expression": Node {
+ "computed": true,
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "object": Node {
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 19,
+ "type": "Identifier",
+ },
+ "property": Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 21,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 19,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 19,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let x = [1, 2, 3];
+x[1];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 2,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 21 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 35,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let x = [1, 2, 3];\\\\nx[1];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let x = [1, 2, 3];
+x[1];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 34,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 35,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 35,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let x = [1, 2, 3];\\\\nx[1];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 35,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 33,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 33,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let x = [1, 2, 3];\\\\nx[1];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let x = [1, 2, 3];
+x[1];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 34,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 35,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 35,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let x = [1, 2, 3];\\\\nx[1];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "array_expression",
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 3,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "object_access",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 22 1`] = `
+"Line 1: Array expressions are not allowed
+Line 1: Mutable variable declaration using keyword 'let' is not allowed.
+Line 2: Member expressions are not allowed
+Line 2: Assignment expressions are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 22 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "x",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 17,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "elements": Array [
+ Node {
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 9,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 12,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 15,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "start": 8,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 18,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 28,
+ "expression": Node {
+ "end": 27,
+ "left": Node {
+ "computed": true,
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "object": Node {
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 19,
+ "type": "Identifier",
+ },
+ "property": Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 21,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 19,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 27,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 2,
+ },
+ },
+ "raw": "4",
+ "start": 26,
+ "type": "Literal",
+ "value": 4,
+ },
+ "start": 19,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 19,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let x = [1, 2, 3];
+x[1] = 4;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "x",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 17,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "elements": Array [
+ Node {
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 9,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 12,
+ "type": "Literal",
+ "value": 2,
+ },
+ Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 15,
+ "type": "Literal",
+ "value": 3,
+ },
+ ],
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "start": 8,
+ "type": "ArrayExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 18,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 28,
+ "expression": Node {
+ "end": 27,
+ "left": Node {
+ "computed": true,
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 4,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "object": Node {
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 19,
+ "type": "Identifier",
+ },
+ "property": Node {
+ "end": 22,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "raw": "1",
+ "start": 21,
+ "type": "Literal",
+ "value": 1,
+ },
+ "start": 19,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 27,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 2,
+ },
+ },
+ "raw": "4",
+ "start": 26,
+ "type": "Literal",
+ "value": 4,
+ },
+ "start": 19,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 19,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let x = [1, 2, 3];
+x[1] = 4;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 4,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 22 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 39,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 37,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 37,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let x = [1, 2, 3];\\\\nx[1] = 4;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let x = [1, 2, 3];
+x[1] = 4;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 38,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 39,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 39,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let x = [1, 2, 3];\\\\nx[1] = 4;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 39,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 37,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 37,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let x = [1, 2, 3];\\\\nx[1] = 4;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let x = [1, 2, 3];
+x[1] = 4;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 38,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 39,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 39,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let x = [1, 2, 3];\\\\nx[1] = 4;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "array_expression",
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 3,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "object_assignment",
+ Array [
+ Array [
+ "object_access",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 4,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 23 1`] = `
+"Line 1: Mutable variable declaration using keyword 'let' is not allowed.
+Line 2: Mutable variable declaration using keyword 'let' is not allowed.
+Line 3: Mutable variable declaration using keyword 'let' is not allowed.
+Line 4: Assignment expressions are not allowed
+Line 4: Assignment expressions are not allowed
+Line 4: Assignment expressions are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 23 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "x",
+ "y",
+ "z",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 8,
+ "type": "Literal",
+ "value": 3,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 20,
+ "id": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "name": "y",
+ "start": 15,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 2,
+ },
+ },
+ "raw": "4",
+ "start": 19,
+ "type": "Literal",
+ "value": 4,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "start": 15,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 21,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 31,
+ "id": Node {
+ "end": 27,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "name": "z",
+ "start": 26,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "raw": "5",
+ "start": 30,
+ "type": "Literal",
+ "value": 5,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "start": 26,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 32,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 3,
+ },
+ },
+ "start": 22,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 47,
+ "expression": Node {
+ "end": 46,
+ "left": Node {
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "x",
+ "start": 33,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 46,
+ "left": Node {
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "name": "y",
+ "start": 37,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 46,
+ "left": Node {
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 4,
+ },
+ },
+ "name": "z",
+ "start": 41,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 4,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 46,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 4,
+ },
+ },
+ "raw": "6",
+ "start": 45,
+ "type": "Literal",
+ "value": 6,
+ },
+ "start": 41,
+ "type": "AssignmentExpression",
+ },
+ "start": 37,
+ "type": "AssignmentExpression",
+ },
+ "start": 33,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 33,
+ "type": "ExpressionStatement",
+ },
+ Node {
+ "end": 50,
+ "expression": Node {
+ "end": 49,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "name": "x",
+ "start": 48,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "start": 48,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 50,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let x = 3;
+let y = 4;
+let z = 5;
+x = y = z = 6;
+x;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "x",
+ "y",
+ "z",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 9,
+ "id": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 4,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "raw": "3",
+ "start": 8,
+ "type": "Literal",
+ "value": 3,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 1,
+ },
+ },
+ "start": 4,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 10,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 20,
+ "id": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "name": "y",
+ "start": 15,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 2,
+ },
+ },
+ "raw": "4",
+ "start": 19,
+ "type": "Literal",
+ "value": 4,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "start": 15,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 21,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 2,
+ },
+ },
+ "start": 11,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "declarations": Array [
+ Node {
+ "end": 31,
+ "id": Node {
+ "end": 27,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "name": "z",
+ "start": 26,
+ "type": "Identifier",
+ },
+ "init": Node {
+ "end": 31,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "raw": "5",
+ "start": 30,
+ "type": "Literal",
+ "value": 5,
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "start": 26,
+ "type": "VariableDeclarator",
+ },
+ ],
+ "end": 32,
+ "kind": "let",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 3,
+ },
+ },
+ "start": 22,
+ "typability": "NotYetTyped",
+ "type": "VariableDeclaration",
+ },
+ Node {
+ "end": 47,
+ "expression": Node {
+ "end": 46,
+ "left": Node {
+ "end": 34,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "x",
+ "start": 33,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 46,
+ "left": Node {
+ "end": 38,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "name": "y",
+ "start": 37,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 46,
+ "left": Node {
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 4,
+ },
+ },
+ "name": "z",
+ "start": 41,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 4,
+ },
+ },
+ "operator": "=",
+ "right": Node {
+ "end": 46,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 12,
+ "line": 4,
+ },
+ },
+ "raw": "6",
+ "start": 45,
+ "type": "Literal",
+ "value": 6,
+ },
+ "start": 41,
+ "type": "AssignmentExpression",
+ },
+ "start": 37,
+ "type": "AssignmentExpression",
+ },
+ "start": 33,
+ "type": "AssignmentExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 33,
+ "type": "ExpressionStatement",
+ },
+ Node {
+ "end": 50,
+ "expression": Node {
+ "end": 49,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "name": "x",
+ "start": 48,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "start": 48,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 50,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 2,
+ "line": 5,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "let x = 3;
+let y = 4;
+let z = 5;
+x = y = z = 6;
+x;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 6,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 23 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 64,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 62,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 62,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let x = 3;\\\\nlet y = 4;\\\\nlet z = 5;\\\\nx = y = z = 6;\\\\nx;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let x = 3;
+let y = 4;
+let z = 5;
+x = y = z = 6;
+x;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 63,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 63,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 64,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let x = 3;\\\\nlet y = 4;\\\\nlet z = 5;\\\\nx = y = z = 6;\\\\nx;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 64,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 62,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 62,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"let x = 3;\\\\nlet y = 4;\\\\nlet z = 5;\\\\nx = y = z = 6;\\\\nx;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "let x = 3;
+let y = 4;
+let z = 5;
+x = y = z = 6;
+x;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 63,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 63,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 64,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"let x = 3;\\\\nlet y = 4;\\\\nlet z = 5;\\\\nx = y = z = 6;\\\\nx;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 3,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "y",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 4,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "variable_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "z",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 5,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
+ Array [
+ "y",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "assignment",
+ Array [
+ Array [
+ "name",
+ Array [
+ "z",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 6,
+ null,
],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 24 1`] = `
+"Line 1: Rest elements are not allowed
+Line 4: Array expressions are not allowed
+Line 4: Spread elements are not allowed"
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 24 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "f",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 39,
+ "left": Node {
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 34,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 2,
+ },
+ },
+ "name": "y",
+ "start": 38,
+ "type": "Identifier",
+ },
+ "start": 34,
+ "type": "BinaryExpression",
+ },
+ "end": 40,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "start": 27,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 1,
+ },
+ },
+ "start": 23,
+ "type": "BlockStatement",
+ },
+ "end": 42,
+ "expression": false,
+ "generator": false,
+ "id": Node {
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "name": "f",
+ "start": 9,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 11,
+ "type": "Identifier",
+ },
+ Node {
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": "y",
+ "start": 14,
+ "type": "Identifier",
+ },
+ Node {
+ "argument": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "name": "z",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "start": 17,
+ "type": "RestElement",
+ },
+ ],
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "FunctionDeclaration",
+ },
+ Node {
+ "end": 56,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "argument": Node {
+ "elements": Array [
+ Node {
+ "end": 50,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 4,
+ },
+ },
+ "raw": "1",
+ "start": 49,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 53,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 4,
+ },
+ },
+ "raw": "2",
+ "start": 52,
+ "type": "Literal",
+ "value": 2,
+ },
+ ],
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "start": 48,
+ "type": "ArrayExpression",
+ },
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 4,
+ },
+ },
+ "start": 45,
+ "type": "SpreadElement",
+ },
+ ],
+ "callee": Node {
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "f",
+ "start": 43,
+ "type": "Identifier",
+ },
+ "end": 55,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 43,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 43,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 56,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "function f(x, y, ...z) {
+ return x + y;
+}
+f(...[1, 2]);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 3,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ "f",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "body": Node {
+ "body": Array [
+ Node {
+ "argument": Node {
+ "end": 39,
+ "left": Node {
+ "end": 35,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "name": "x",
+ "start": 34,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 2,
+ },
+ },
+ "operator": "+",
+ "right": Node {
+ "end": 39,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 13,
+ "line": 2,
+ },
+ },
+ "name": "y",
+ "start": 38,
+ "type": "Identifier",
+ },
+ "start": 34,
+ "type": "BinaryExpression",
+ },
+ "end": 40,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 2,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "start": 27,
+ "type": "ReturnStatement",
+ },
+ ],
+ "end": 42,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 23,
+ "line": 1,
+ },
+ },
+ "start": 23,
+ "type": "BlockStatement",
+ },
+ "end": 42,
+ "expression": false,
+ "generator": false,
+ "id": Node {
+ "end": 10,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 1,
+ },
+ },
+ "name": "f",
+ "start": 9,
+ "type": "Identifier",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 3,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "params": Array [
+ Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "name": "x",
+ "start": 11,
+ "type": "Identifier",
+ },
+ Node {
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": "y",
+ "start": 14,
+ "type": "Identifier",
+ },
+ Node {
+ "argument": Node {
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 20,
+ "line": 1,
+ },
+ },
+ "name": "z",
+ "start": 20,
+ "type": "Identifier",
+ },
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "start": 17,
+ "type": "RestElement",
+ },
+ ],
+ "start": 0,
+ "typability": "NotYetTyped",
+ "type": "FunctionDeclaration",
+ },
+ Node {
+ "end": 56,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "argument": Node {
+ "elements": Array [
+ Node {
+ "end": 50,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 7,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 4,
+ },
+ },
+ "raw": "1",
+ "start": 49,
+ "type": "Literal",
+ "value": 1,
+ },
+ Node {
+ "end": 53,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 10,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 9,
+ "line": 4,
+ },
+ },
+ "raw": "2",
+ "start": 52,
+ "type": "Literal",
+ "value": 2,
+ },
+ ],
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "start": 48,
+ "type": "ArrayExpression",
+ },
+ "end": 54,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 11,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 4,
+ },
+ },
+ "start": 45,
+ "type": "SpreadElement",
+ },
+ ],
+ "callee": Node {
+ "end": 44,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 1,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "name": "f",
+ "start": 43,
+ "type": "Identifier",
+ },
+ "end": 55,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 43,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 4,
+ },
+ },
+ "start": 43,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 56,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 4,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "arity": [Function],
+ "array_length": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "function f(x, y, ...z) {
+ return x + y;
+}
+f(...[1, 2]);",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 3,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 24 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 69,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 67,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 67,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"function f(x, y, ...z) {\\\\n return x + y;\\\\n}\\\\nf(...[1, 2]);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "function f(x, y, ...z) {
+ return x + y;
+}
+f(...[1, 2]);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 68,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 68,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 69,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 69,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 69,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"function f(x, y, ...z) {\\\\n return x + y;\\\\n}\\\\nf(...[1, 2]);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 4,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 69,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 67,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 67,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"function f(x, y, ...z) {\\\\n return x + y;\\\\n}\\\\nf(...[1, 2]);\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "function f(x, y, ...z) {
+ return x + y;
+}
+f(...[1, 2]);",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 68,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 68,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 69,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 69,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 69,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "head": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"function f(x, y, ...z) {\\\\n return x + y;\\\\n}\\\\nf(...[1, 2]);\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "sequence",
+ Array [
+ Array [
+ Array [
+ "function_declaration",
+ Array [
+ Array [
+ "name",
+ Array [
+ "f",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "y",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "rest_element",
+ Array [
+ Array [
+ "name",
+ Array [
+ "z",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "return_statement",
+ Array [
+ Array [
+ "binary_operator_combination",
+ Array [
+ "+",
+ Array [
+ Array [
+ "name",
+ Array [
+ "x",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "name",
+ Array [
+ "y",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "application",
+ Array [
+ Array [
+ "name",
+ Array [
+ "f",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ Array [
+ "spread_element",
+ Array [
+ Array [
+ "array_expression",
+ Array [
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
null,
],
],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 25 1`] = `"Line 1: Object expressions are not allowed"`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 25 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 5,
+ "expression": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({});",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 5,
+ "expression": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({});",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Object {},
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 25 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({});\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({});",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({});\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({});\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({});",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 14,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({});\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "object_expression",
+ Array [
+ null,
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 26 1`] = `"Line 1: Object expressions are not allowed"`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 26 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 6,
+ "key": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 2,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+ "value": Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ },
+ Node {
+ "computed": false,
+ "end": 12,
+ "key": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 8,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 8,
+ "type": "Property",
+ "value": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ },
+ ],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({a: 1, b: 2});",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 15,
+ "expression": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 6,
+ "key": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 2,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+ "value": Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ },
+ Node {
+ "computed": false,
+ "end": 12,
+ "key": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 8,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 8,
+ "type": "Property",
+ "value": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ },
+ ],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 15,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({a: 1, b: 2});",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Object {
+ "a": 1,
+ "b": 2,
+ },
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 26 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 25,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({a: 1, b: 2});\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({a: 1, b: 2});",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({a: 1, b: 2});\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 25,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 23,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 23,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({a: 1, b: 2});\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({a: 1, b: 2});",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 24,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 24,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({a: 1, b: 2});\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "object_expression",
+ Array [
+ Array [
+ Array [
+ "key_value_pair",
+ Array [
+ Array [
+ "property",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "key_value_pair",
+ Array [
+ Array [
+ "property",
+ Array [
+ "b",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 27 1`] = `"Line 1: Object expressions are not allowed"`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 27 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 20,
+ "expression": Node {
+ "computed": true,
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 6,
+ "key": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 2,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+ "value": Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ },
+ Node {
+ "computed": false,
+ "end": 12,
+ "key": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 8,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 8,
+ "type": "Property",
+ "value": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ },
+ ],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "property": Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "'a'",
+ "start": 15,
+ "type": "Literal",
+ "value": "a",
+ },
+ "start": 0,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({a: 1, b: 2})['a'];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 20,
+ "expression": Node {
+ "computed": true,
+ "end": 19,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 6,
+ "key": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 2,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+ "value": Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ },
+ Node {
+ "computed": false,
+ "end": 12,
+ "key": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 8,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 8,
+ "type": "Property",
+ "value": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ },
+ ],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "property": Node {
+ "end": 18,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "'a'",
+ "start": 15,
+ "type": "Literal",
+ "value": "a",
+ },
+ "start": 0,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({a: 1, b: 2})['a'];",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 1,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 27 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 30,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({a: 1, b: 2})['a'];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({a: 1, b: 2})['a'];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 29,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 29,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 30,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 30,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 30,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({a: 1, b: 2})['a'];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 30,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 28,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 28,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({a: 1, b: 2})['a'];\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({a: 1, b: 2})['a'];",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 29,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 29,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 30,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 30,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 30,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({a: 1, b: 2})['a'];\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "object_access",
+ Array [
+ Array [
+ "object_expression",
+ Array [
+ Array [
+ Array [
+ "key_value_pair",
+ Array [
+ Array [
+ "property",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "key_value_pair",
+ Array [
+ Array [
+ "property",
+ Array [
+ "b",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 28 1`] = `
+"Line 1: Object expressions are not allowed
+Line 1: Dot abbreviations are not allowed."
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 28 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 17,
+ "expression": Node {
+ "computed": false,
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 6,
+ "key": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 2,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+ "value": Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ },
+ Node {
+ "computed": false,
+ "end": 12,
+ "key": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 8,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 8,
+ "type": "Property",
+ "value": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ },
+ ],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "property": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 15,
+ "type": "Identifier",
+ },
+ "start": 0,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({a: 1, b: 2}).a;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 17,
+ "expression": Node {
+ "computed": false,
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 6,
+ "key": Node {
+ "end": 3,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 3,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 2,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+ "value": Node {
+ "end": 6,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 6,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 5,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 5,
+ "type": "Literal",
+ "value": 1,
+ },
+ },
+ Node {
+ "computed": false,
+ "end": 12,
+ "key": Node {
+ "end": 9,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 9,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "name": "b",
+ "start": 8,
+ "type": "Identifier",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 8,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 8,
+ "type": "Property",
+ "value": Node {
+ "end": 12,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 11,
+ "type": "Literal",
+ "value": 2,
+ },
+ },
+ ],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "property": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 15,
+ "type": "Identifier",
+ },
+ "start": 0,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({a: 1, b: 2}).a;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": 1,
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 28 3`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 27,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({a: 1, b: 2}).a;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({a: 1, b: 2}).a;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 27,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({a: 1, b: 2}).a;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 27,
+ "expression": Node {
+ "arguments": Array [
+ Node {
+ "end": 25,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 25,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "raw": "\\"({a: 1, b: 2}).a;\\"",
+ "start": 6,
+ "type": "Literal",
+ "value": "({a: 1, b: 2}).a;",
+ },
+ ],
+ "callee": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "name": "parse",
+ "start": 0,
+ "type": "Identifier",
+ },
+ "end": 26,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 26,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "CallExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 27,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 27,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "parse(\\"({a: 1, b: 2}).a;\\");",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "status": "finished",
+ "value": Array [
+ "object_access",
+ Array [
+ Array [
+ "object_expression",
+ Array [
+ Array [
+ Array [
+ "key_value_pair",
+ Array [
+ Array [
+ "property",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 1,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ Array [
+ Array [
+ "key_value_pair",
+ Array [
+ Array [
+ "property",
+ Array [
+ "b",
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "literal",
+ Array [
+ 2,
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ Array [
+ Array [
+ "property",
+ Array [
+ "a",
+ null,
+ ],
+ ],
+ null,
+ ],
+ ],
+ ],
+ },
+}
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 29 1`] = `
+"Line 1: Object expressions are not allowed
+Line 1: Dot abbreviations are not allowed."
+`;
+
+exports[`Syntaxes are allowed in the chapter they are introduced 29 2`] = `
+Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 21,
+ "expression": Node {
+ "computed": false,
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 8,
+ "key": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "raw": "'a'",
+ "start": 2,
+ "type": "Literal",
+ "value": "a",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+ "value": Node {
+ "end": 8,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 7,
+ "line": 1,
+ },
+ },
+ "raw": "1",
+ "start": 7,
+ "type": "Literal",
+ "value": 1,
+ },
+ },
+ Node {
+ "computed": false,
+ "end": 16,
+ "key": Node {
+ "end": 13,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 13,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 1,
+ },
+ },
+ "raw": "'b'",
+ "start": 10,
+ "type": "Literal",
+ "value": "b",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 10,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 10,
+ "type": "Property",
+ "value": Node {
+ "end": 16,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "raw": "2",
+ "start": 15,
+ "type": "Literal",
+ "value": 2,
+ },
+ },
+ ],
+ "start": 1,
+ "type": "ObjectExpression",
+ },
+ "property": Node {
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "start": 19,
+ "type": "Identifier",
+ },
+ "start": 0,
+ "type": "MemberExpression",
+ },
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "start": 0,
+ "type": "ExpressionStatement",
+ },
+ ],
+ "end": 21,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "sourceType": "module",
+ "start": 0,
+ "type": "Program",
+ },
+ ],
+ "promptResult": Array [],
+ "runtime": Object {
+ "break": false,
+ "breakpointSteps": Array [],
+ "changepointSteps": Array [],
+ "control": null,
+ "debuggerOn": true,
+ "envSteps": -1,
+ "envStepsTotal": 0,
+ "environmentTree": EnvTree {
+ "_root": EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ "map": Map {
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ } => EnvTreeNode {
+ "_children": Array [],
+ "environment": Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ "parent": null,
+ },
+ },
+ },
+ "environments": Array [
+ Object {
+ "head": Object {
+ "Infinity": Infinity,
+ "NaN": NaN,
+ "alert": [Function],
+ "apply_in_underlying_javascript": [Function],
+ "arity": [Function],
+ "array_length": [Function],
+ "call_cc": [Function],
+ "char_at": [Function],
+ "display": [Function],
+ "display_list": [Function],
+ "draw_data": [Function],
+ "error": [Function],
+ "get_time": [Function],
+ "has_own_property": [Function],
+ "head": [Function],
+ "is_NaN": [Function],
+ "is_array": [Function],
+ "is_boolean": [Function],
+ "is_function": [Function],
+ "is_list": [Function],
+ "is_null": [Function],
+ "is_number": [Function],
+ "is_object": [Function],
+ "is_pair": [Function],
+ "is_string": [Function],
+ "is_undefined": [Function],
+ "list": [Function],
+ "math_E": 2.718281828459045,
+ "math_LN10": 2.302585092994046,
+ "math_LN2": 0.6931471805599453,
+ "math_LOG10E": 0.4342944819032518,
+ "math_LOG2E": 1.4426950408889634,
+ "math_PI": 3.141592653589793,
+ "math_SQRT1_2": 0.7071067811865476,
+ "math_SQRT2": 1.4142135623730951,
+ "math_abs": [Function],
+ "math_acos": [Function],
+ "math_acosh": [Function],
+ "math_asin": [Function],
+ "math_asinh": [Function],
+ "math_atan": [Function],
+ "math_atan2": [Function],
+ "math_atanh": [Function],
+ "math_cbrt": [Function],
+ "math_ceil": [Function],
+ "math_clz32": [Function],
+ "math_cos": [Function],
+ "math_cosh": [Function],
+ "math_exp": [Function],
+ "math_expm1": [Function],
+ "math_floor": [Function],
+ "math_fround": [Function],
+ "math_hypot": [Function],
+ "math_imul": [Function],
+ "math_log": [Function],
+ "math_log10": [Function],
+ "math_log1p": [Function],
+ "math_log2": [Function],
+ "math_max": [Function],
+ "math_min": [Function],
+ "math_pow": [Function],
+ "math_random": [Function],
+ "math_round": [Function],
+ "math_sign": [Function],
+ "math_sin": [Function],
+ "math_sinh": [Function],
+ "math_sqrt": [Function],
+ "math_tan": [Function],
+ "math_tanh": [Function],
+ "math_trunc": [Function],
+ "pair": [Function],
+ "parse": [Function],
+ "parse_int": [Function],
+ "prompt": [Function],
+ "raw_display": [Function],
+ "set_head": [Function],
+ "set_tail": [Function],
+ "stream": [Function],
+ "stringify": [Function],
+ "tail": [Function],
+ "timed": [Function],
+ "tokenize": [Function],
+ "undefined": undefined,
+ },
+ "heap": Heap {
+ "storage": null,
+ },
+ "id": "-1",
+ "name": "global",
+ "tail": null,
+ },
+ ],
+ "isRunning": false,
+ "nodes": Array [],
+ "objectCount": 0,
+ "stash": null,
+ "transformers": Transformers {
+ "items": Map {},
+ "parent": null,
+ },
+ "value": undefined,
+ },
+ "shouldIncreaseEvaluationTimeout": false,
+ "typeEnvironment": Array [
+ Object {
+ "declKindMap": Map {
+ "Infinity" => "const",
+ "NaN" => "const",
+ "undefined" => "const",
+ "math_E" => "const",
+ "math_LN2" => "const",
+ "math_LN10" => "const",
+ "math_LOG2E" => "const",
+ "math_LOG10E" => "const",
+ "math_PI" => "const",
+ "math_SQRT1_2" => "const",
+ "math_SQRT2" => "const",
+ "is_boolean" => "const",
+ "is_number" => "const",
+ "is_string" => "const",
+ "is_undefined" => "const",
+ "is_function" => "const",
+ "math_abs" => "const",
+ "math_acos" => "const",
+ "math_acosh" => "const",
+ "math_asin" => "const",
+ "math_asinh" => "const",
+ "math_atan" => "const",
+ "math_atan2" => "const",
+ "math_atanh" => "const",
+ "math_cbrt" => "const",
+ "math_ceil" => "const",
+ "math_clz32" => "const",
+ "math_cos" => "const",
+ "math_cosh" => "const",
+ "math_exp" => "const",
+ "math_expm1" => "const",
+ "math_floor" => "const",
+ "math_fround" => "const",
+ "math_hypot" => "const",
+ "math_imul" => "const",
+ "math_log" => "const",
+ "math_log1p" => "const",
+ "math_log2" => "const",
+ "math_log10" => "const",
+ "math_max" => "const",
+ "math_min" => "const",
+ "math_pow" => "const",
+ "math_random" => "const",
+ "math_round" => "const",
+ "math_sign" => "const",
+ "math_sin" => "const",
+ "math_sinh" => "const",
+ "math_sqrt" => "const",
+ "math_tan" => "const",
+ "math_tanh" => "const",
+ "math_trunc" => "const",
+ "parse_int" => "const",
+ "prompt" => "const",
+ "get_time" => "const",
+ "stringify" => "const",
+ "display" => "const",
+ "error" => "const",
+ "-_1" => "const",
+ "!" => "const",
+ "&&" => "const",
+ "||" => "const",
+ "<" => "const",
+ "<=" => "const",
+ ">" => "const",
+ ">=" => "const",
+ "+" => "const",
+ "%" => "const",
+ "-" => "const",
+ "*" => "const",
+ "/" => "const",
+ "pair" => "const",
+ "head" => "const",
+ "tail" => "const",
+ "is_pair" => "const",
+ "is_null" => "const",
+ "is_list" => "const",
+ "list" => "const",
+ "===" => "const",
+ "!==" => "const",
+ "set_head" => "const",
+ "set_tail" => "const",
+ "is_array" => "const",
+ "array_length" => "const",
+ "raw_display" => "const",
+ "char_at" => "const",
+ "arity" => "const",
+ "draw_data" => "const",
+ "display_list" => "const",
+ "stream" => "const",
+ "parse" => "const",
+ "tokenize" => "const",
+ "apply_in_underlying_javascript" => "const",
+ "call_cc" => "const",
+ "is_object" => "const",
+ "is_NaN" => "const",
+ "has_own_property" => "const",
+ "alert" => "const",
+ "timed" => "const",
+ },
+ "typeAliasMap": Map {
+ "Pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "List" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ "Stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "Stream",
+ "typeArgs": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ },
+ "typeParams": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ },
+ },
+ "typeMap": Map {
+ "Infinity" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": Infinity,
+ },
+ "NaN" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": NaN,
+ },
+ "undefined" => Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "math_E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.718281828459045,
+ },
+ "math_LN2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.6931471805599453,
+ },
+ "math_LN10" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 2.302585092994046,
+ },
+ "math_LOG2E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4426950408889634,
+ },
+ "math_LOG10E" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.4342944819032518,
+ },
+ "math_PI" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 3.141592653589793,
+ },
+ "math_SQRT1_2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 0.7071067811865476,
+ },
+ "math_SQRT2" => Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": 1.4142135623730951,
+ },
+ "is_boolean" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_number" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_string" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_undefined" => Object {
+ "ifTrueType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_function" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "U",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "math_abs" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_acosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_asinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atan2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_atanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cbrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_ceil" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_clz32" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cos" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_cosh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_exp" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_expm1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_floor" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_fround" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_hypot" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_imul" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log1p" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log2" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_log10" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_max" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_min" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "math_pow" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_random" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_round" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sign" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sin" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sinh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_sqrt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tan" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_tanh" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "math_trunc" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "parse_int" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "prompt" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "get_time" => Object {
+ "kind": "function",
+ "parameterTypes": Array [],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "stringify" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "string",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "error" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "-_1" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "!" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "&&" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "||" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "<=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ ">=" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "+" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ ],
+ "returnType": Object {
+ "constraint": "addable",
+ "kind": "variable",
+ "name": "A",
+ },
+ },
+ "typeParams": undefined,
+ },
+ "%" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "-" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "*" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "/" => Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "pair" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ },
+ "typeParams": undefined,
+ },
+ "head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ ],
+ "returnType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_pair" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_null" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "is_list" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "list",
+ "typeAsPair": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "===" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "!==" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T2",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "boolean",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_head" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "set_tail" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "headType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "headType",
+ "typeArgs": undefined,
+ },
+ "kind": "pair",
+ "tailType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ },
+ Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "tailType",
+ "typeArgs": undefined,
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "undefined",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "is_array" => Object {
+ "ifTrueType": Object {
+ "kind": "forall",
+ "polyType": Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ "typeParams": undefined,
+ },
+ "kind": "predicate",
+ },
+ "array_length" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "kind": "function",
+ "parameterTypes": Array [
+ Object {
+ "elementType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T",
+ "typeArgs": undefined,
+ },
+ "kind": "array",
+ },
+ ],
+ "returnType": Object {
+ "kind": "primitive",
+ "name": "number",
+ "value": undefined,
+ },
+ },
+ "typeParams": undefined,
+ },
+ "raw_display" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "char_at" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "arity" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "draw_data" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "display_list" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "stream" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "parse" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "tokenize" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "apply_in_underlying_javascript" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "call_cc" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_object" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "is_NaN" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "has_own_property" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "alert" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ "timed" => Object {
+ "kind": "forall",
+ "polyType": Object {
+ "constraint": "none",
+ "kind": "variable",
+ "name": "T1",
+ "typeArgs": undefined,
+ },
+ "typeParams": undefined,
+ },
+ },
+ },
+ ],
+ "unTypecheckedCode": Array [
+ "({'a': 1, 'b': 2}).a;",
+ "
+
+// equal computes the structural equality
+// over its arguments
+
+function equal(xs, ys) {
+ return is_pair(xs)
+ ? (is_pair(ys) &&
+ equal(head(xs), head(ys)) &&
+ equal(tail(xs), tail(ys)))
+ : is_null(xs)
+ ? is_null(ys)
+ : is_number(xs)
+ ? (is_number(ys) && xs === ys)
+ : is_boolean(xs)
+ ? (is_boolean(ys) && ((xs && ys) || (!xs && !ys)))
+ : is_string(xs)
+ ? (is_string(ys) && xs === ys)
+ : is_undefined(xs)
+ ? is_undefined(ys)
+ : is_function(xs)
+ // we know now that xs is a function,
+ // but we use an if check anyway to make use of the type predicate
+ ? (is_function(ys) && xs === ys)
+ : false;
+}
+
+
+// returns the length of a given argument list
+// assumes that the argument is a list
+
+function $length(xs, acc) {
+ return is_null(xs) ? acc : $length(tail(xs), acc + 1);
+}
+function length(xs) {
+ return $length(xs, 0);
+}
+
+// map applies first arg f, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// f is applied element-by-element:
+// map(f, list(1, 2)) results in list(f(1), f(2))
+
+function $map(f, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : $map(f, tail(xs), pair(f(head(xs)), acc));
+}
+function map(f, xs) {
+ return $map(f, xs, null);
+}
+
+// build_list takes a a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_list returns a list of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+
+function $build_list(i, fun, already_built) {
+ return i < 0 ? already_built : $build_list(i - 1, fun, pair(fun(i), already_built));
+}
+
+function build_list(fun, n) {
+ return $build_list(n - 1, fun, null);
+}
+
+// for_each applies first arg fun, assumed to be a unary function,
+// to the elements of the second argument, assumed to be a list.
+// fun is applied element-by-element:
+// for_each(fun, list(1, 2)) results in the calls fun(1) and fun(2).
+// for_each returns true.
+
+function for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return for_each(fun, tail(xs));
+ }
+}
+
+// list_to_string returns a string that represents the argument list.
+// It applies itself recursively on the elements of the given list.
+// When it encounters a non-list, it applies to_string to it.
+
+function $list_to_string(xs, cont) {
+ return is_null(xs)
+ ? cont(\\"null\\")
+ : is_pair(xs)
+ ? $list_to_string(
+ head(xs),
+ x => $list_to_string(
+ tail(xs),
+ y => cont(\\"[\\" + x + \\",\\" + y + \\"]\\")))
+ : cont(stringify(xs));
+}
+
+function list_to_string(xs) {
+ return $list_to_string(xs, x => x);
+}
+
+// reverse reverses the argument, assumed to be a list
+
+function $reverse(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : $reverse(tail(original), pair(head(original), reversed));
+}
+
+function reverse(xs) {
+ return $reverse(xs, null);
+}
+
+// append first argument, assumed to be a list, to the second argument.
+// In the result null at the end of the first argument list
+// is replaced by the second argument, regardless what the second
+// argument consists of.
+
+function $append(xs, ys, cont) {
+ return is_null(xs)
+ ? cont(ys)
+ : $append(tail(xs), ys, zs => cont(pair(head(xs), zs)));
+}
+
+function append(xs, ys) {
+ return $append(xs, ys, xs => xs);
+}
+
+// member looks for a given first-argument element in the
+// second argument, assumed to be a list. It returns the first
+// postfix sublist that starts with the given element. It returns null if the
+// element does not occur in the list
+
+function member(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? xs
+ : member(v, tail(xs));
+}
+
+// removes the first occurrence of a given first-argument element
+// in second-argument, assmed to be a list. Returns the original
+// list if there is no occurrence.
+
+function $remove(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? app(rev(acc), tail(xs))
+ : $remove(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove(v, xs) {
+ return $remove(v, xs, null);
+}
+
+// Similar to remove, but removes all instances of v
+// instead of just the first
+
+function $remove_all(v, xs, acc) {
+ // Ensure that typechecking of append and reverse are done independently
+ const app = append;
+ const rev = reverse;
+ return is_null(xs)
+ ? app(rev(acc), xs)
+ : v === head(xs)
+ ? $remove_all(v, tail(xs), acc)
+ : $remove_all(v, tail(xs), pair(head(xs), acc));
+}
+
+function remove_all(v, xs) {
+ return $remove_all(v, xs, null);
+}
+
+// filter returns the sublist of elements of the second argument
+// (assumed to be a list), for which the given predicate function
+// returns true.
+
+function $filter(pred, xs, acc) {
+ return is_null(xs)
+ ? reverse(acc)
+ : pred(head(xs))
+ ? $filter(pred, tail(xs), pair(head(xs), acc))
+ : $filter(pred, tail(xs), acc);
+}
+
+function filter(pred, xs) {
+ return $filter(pred, xs, null);
+}
+
+// enumerates numbers starting from start, assumed to be a number,
+// using a step size of 1, until the number exceeds end, assumed
+// to be a number
+
+function $enum_list(start, end, acc) {
+ // Ensure that typechecking of reverse are done independently
+ const rev = reverse;
+ return start > end
+ ? rev(acc)
+ : $enum_list(start + 1, end, pair(start, acc));
+}
+
+function enum_list(start, end) {
+ return $enum_list(start, end, null);
+}
+
+// Returns the item in xs (assumed to be a list) at index n,
+// assumed to be a nonnegative integer.
+// Note: the first item is at position 0
+
+function list_ref(xs, n) {
+ return n === 0
+ ? head(xs)
+ : list_ref(tail(xs), n - 1);
+}
+
+// accumulate applies an operation op (assumed to be a binary function)
+// to elements of sequence (assumed to be a list) in a right-to-left order.
+// first apply op to the last element and initial, resulting in r1, then to
+// the second-last element and r1, resulting in r2, etc, and finally
+// to the first element and r_n-1, where n is the length of the
+// list.
+// accumulate(op, zero, list(1, 2, 3)) results in
+// op(1, op(2, op(3, zero)))
+
+function $accumulate(f, initial, xs, cont) {
+ return is_null(xs)
+ ? cont(initial)
+ : $accumulate(f, initial, tail(xs), x => cont(f(head(xs), x)));
+}
+
+function accumulate(f, initial, xs) {
+ return $accumulate(f, initial, xs, x => x);
+}
+
+function __access_named_export__(named_exports, lookup_name) {
+ if (is_null(named_exports)) {
+ return undefined;
+ } else {
+ const name = head(head(named_exports));
+ const identifier = tail(head(named_exports));
+ if (name === lookup_name) {
+ return identifier;
+ } else {
+ return __access_named_export__(tail(named_exports), lookup_name);
+ }
+ }
+}
+
+function __access_export__(exports, lookup_name) {
+ if (lookup_name === \\"default\\") {
+ return head(exports);
+ } else {
+ const named_exports = tail(exports);
+ return __access_named_export__(named_exports, lookup_name);
+ }
+}
+
+
+// Supporting streams in the Scheme style, following
+// \\"stream discipline\\"
+
+// stream_tail returns the second component of the given pair
+// throws an error if the argument is not a pair
+
+function stream_tail(xs) {
+ if (is_pair(xs)) {
+ const the_tail = tail(xs);
+ if (is_function(the_tail)) {
+ return the_tail();
+ } else {
+ error(the_tail,
+ 'stream_tail(xs) expects a function as ' +
+ 'the tail of the argument pair xs, ' +
+ 'but encountered ');
+ }
+ } else {
+ error(xs, 'stream_tail(xs) expects a pair as ' +
+ 'argument xs, but encountered ');
+ }
+}
+
+// is_stream recurses down the stream and checks that it ends with the
+// empty list null
+
+function is_stream(xs) {
+ return is_null(xs) ||
+ (is_pair(xs) &&
+ is_function(tail(xs)) &&
+ arity(tail(xs)) === 0 &&
+ is_stream(stream_tail(xs)));
+}
+
+// A stream is either null or a pair whose tail is
+// a nullary function that returns a stream.
+
+function list_to_stream(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs),
+ () => list_to_stream(tail(xs)));
+}
+
+// stream_to_list transforms a given stream to a list
+// Lazy? No: stream_to_list needs to force the whole stream
+function stream_to_list(xs) {
+ return is_null(xs)
+ ? null
+ : pair(head(xs), stream_to_list(stream_tail(xs)));
+}
+
+// stream_length returns the length of a given argument stream
+// throws an exception if the argument is not a stream
+// Lazy? No: The function needs to explore the whole stream
+function stream_length(xs) {
+ return is_null(xs)
+ ? 0
+ : 1 + stream_length(stream_tail(xs));
+}
+
+// stream_map applies first arg f to the elements of the second
+// argument, assumed to be a stream.
+// f is applied element-by-element:
+// stream_map(f,list_to_stream(list(1,2)) results in
+// the same as list_to_stream(list(f(1),f(2)))
+// stream_map throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? Yes: The argument stream is only explored as forced by
+// the result stream.
+function stream_map(f, s) {
+ return is_null(s)
+ ? null
+ : pair(f(head(s)),
+ () => stream_map(f, stream_tail(s)));
+}
+
+// build_stream takes a function fun as first argument,
+// and a nonnegative integer n as second argument,
+// build_stream returns a stream of n elements, that results from
+// applying fun to the numbers from 0 to n-1.
+// Lazy? Yes: The result stream forces the applications of fun
+// for the next element
+function build_stream(fun, n) {
+ function build(i) {
+ return i >= n
+ ? null
+ : pair(fun(i),
+ () => build(i + 1));
+ }
+ return build(0);
+}
+
+// stream_for_each applies first arg fun to the elements of the stream
+// passed as second argument. fun is applied element-by-element:
+// for_each(fun,list_to_stream(list(1, 2,null))) results in the calls fun(1)
+// and fun(2).
+// stream_for_each returns true.
+// stream_for_each throws an exception if the second argument is not a
+// stream, and if the second argument is a nonempty stream and the
+// first argument is not a function.
+// Lazy? No: stream_for_each forces the exploration of the entire stream
+function stream_for_each(fun, xs) {
+ if (is_null(xs)) {
+ return true;
+ } else {
+ fun(head(xs));
+ return stream_for_each(fun, stream_tail(xs));
+ }
+}
+
+// stream_reverse reverses the argument stream
+// stream_reverse throws an exception if the argument is not a stream.
+// Lazy? No: stream_reverse forces the exploration of the entire stream
+function stream_reverse(xs) {
+ function rev(original, reversed) {
+ return is_null(original)
+ ? reversed
+ : rev(stream_tail(original),
+ pair(head(original), () => reversed));
+ }
+ return rev(xs, null);
+}
+
+// stream_append appends first argument stream and second argument stream.
+// In the result, null at the end of the first argument stream
+// is replaced by the second argument stream
+// stream_append throws an exception if the first argument is not a
+// stream.
+// Lazy? Yes: the result stream forces the actual append operation
+function stream_append(xs, ys) {
+ return is_null(xs)
+ ? ys
+ : pair(head(xs),
+ () => stream_append(stream_tail(xs), ys));
+}
+
+// stream_member looks for a given first-argument element in a given
+// second argument stream. It returns the first postfix substream
+// that starts with the given element. It returns null if the
+// element does not occur in the stream
+// Lazy? Sort-of: stream_member forces the stream only until the element is found.
+function stream_member(x, s) {
+ return is_null(s)
+ ? null
+ : head(s) === x
+ ? s
+ : stream_member(x, stream_tail(s));
+}
+
+// stream_remove removes the first occurrence of a given first-argument element
+// in a given second-argument list. Returns the original list
+// if there is no occurrence.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_tail(xs)
+ : pair(head(xs),
+ () => stream_remove(v, stream_tail(xs)));
+}
+
+// stream_remove_all removes all instances of v instead of just the first.
+// Lazy? Yes: the result stream forces the construction of each next element
+function stream_remove_all(v, xs) {
+ return is_null(xs)
+ ? null
+ : v === head(xs)
+ ? stream_remove_all(v, stream_tail(xs))
+ : pair(head(xs), () => stream_remove_all(v, stream_tail(xs)));
+}
+
+// filter returns the substream of elements of given stream s
+// for which the given predicate function p returns true.
+// Lazy? Yes: The result stream forces the construction of
+// each next element. Of course, the construction
+// of the next element needs to go down the stream
+// until an element is found for which p holds.
+function stream_filter(p, s) {
+ return is_null(s)
+ ? null
+ : p(head(s))
+ ? pair(head(s),
+ () => stream_filter(p, stream_tail(s)))
+ : stream_filter(p, stream_tail(s));
+}
+
+// enumerates numbers starting from start,
+// using a step size of 1, until the number
+// exceeds end.
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function enum_stream(start, end) {
+ return start > end
+ ? null
+ : pair(start,
+ () => enum_stream(start + 1, end));
+}
+
+// integers_from constructs an infinite stream of integers
+// starting at a given number n
+// Lazy? Yes: The result stream forces the construction of
+// each next element
+function integers_from(n) {
+ return pair(n,
+ () => integers_from(n + 1));
+}
+
+// eval_stream constructs the list of the first n elements
+// of a given stream s
+// Lazy? Sort-of: eval_stream only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function eval_stream(s, n) {
+ function es(s, n) {
+ return n === 1
+ ? list(head(s))
+ : pair(head(s),
+ es(stream_tail(s), n - 1));
+ }
+ return n === 0
+ ? null
+ : es(s, n);
+}
+
+// Returns the item in stream s at index n (the first item is at position 0)
+// Lazy? Sort-of: stream_ref only forces the computation of
+// the first n elements, and leaves the rest of
+// the stream untouched.
+function stream_ref(s, n) {
+ return n === 0
+ ? head(s)
+ : stream_ref(stream_tail(s), n - 1);
+}
+",
+ ],
+ "variant": "default",
+ "visualiseListResult": Array [],
+ },
+ "result": Object {
+ "context": Object {
+ "alertResult": Array [],
+ "chapter": 100,
+ "debugger": Object {
+ "observers": Object {
+ "callbacks": Array [],
+ },
+ "state": Object {
+ "it": Object {},
+ },
+ "status": false,
+ },
+ "displayResult": Array [],
+ "errors": Array [],
+ "executionMethod": "native",
+ "externalContext": undefined,
+ "externalSymbols": Array [],
+ "moduleContexts": Object {},
+ "nativeStorage": Object {
+ "builtins": Map {
+ "get_time" => [Function],
+ "display" => [Function],
+ "raw_display" => [Function],
+ "stringify" => [Function],
+ "error" => [Function],
+ "prompt" => [Function],
+ "is_number" => [Function],
+ "is_string" => [Function],
+ "is_function" => [Function],
+ "is_boolean" => [Function],
+ "is_undefined" => [Function],
+ "parse_int" => [Function],
+ "char_at" => [Function],
+ "arity" => [Function],
+ "undefined" => undefined,
+ "NaN" => NaN,
+ "Infinity" => Infinity,
+ "math_abs" => [Function],
+ "math_acos" => [Function],
+ "math_acosh" => [Function],
+ "math_asin" => [Function],
+ "math_asinh" => [Function],
+ "math_atan" => [Function],
+ "math_atanh" => [Function],
+ "math_atan2" => [Function],
+ "math_ceil" => [Function],
+ "math_cbrt" => [Function],
+ "math_expm1" => [Function],
+ "math_clz32" => [Function],
+ "math_cos" => [Function],
+ "math_cosh" => [Function],
+ "math_exp" => [Function],
+ "math_floor" => [Function],
+ "math_fround" => [Function],
+ "math_hypot" => [Function],
+ "math_imul" => [Function],
+ "math_log" => [Function],
+ "math_log1p" => [Function],
+ "math_log2" => [Function],
+ "math_log10" => [Function],
+ "math_max" => [Function],
+ "math_min" => [Function],
+ "math_pow" => [Function],
+ "math_random" => [Function],
+ "math_round" => [Function],
+ "math_sign" => [Function],
+ "math_sin" => [Function],
+ "math_sinh" => [Function],
+ "math_sqrt" => [Function],
+ "math_tan" => [Function],
+ "math_tanh" => [Function],
+ "math_trunc" => [Function],
+ "math_E" => 2.718281828459045,
+ "math_LN10" => 2.302585092994046,
+ "math_LN2" => 0.6931471805599453,
+ "math_LOG10E" => 0.4342944819032518,
+ "math_LOG2E" => 1.4426950408889634,
+ "math_PI" => 3.141592653589793,
+ "math_SQRT1_2" => 0.7071067811865476,
+ "math_SQRT2" => 1.4142135623730951,
+ "pair" => [Function],
+ "is_pair" => [Function],
+ "head" => [Function],
+ "tail" => [Function],
+ "is_null" => [Function],
+ "list" => [Function],
+ "draw_data" => [Function],
+ "display_list" => [Function],
+ "is_list" => [Function],
+ "set_head" => [Function],
+ "set_tail" => [Function],
+ "array_length" => [Function],
+ "is_array" => [Function],
+ "stream" => [Function],
+ "parse" => [Function],
+ "tokenize" => [Function],
+ "apply_in_underlying_javascript" => [Function],
+ "call_cc" => [Function],
+ "is_object" => [Function],
+ "is_NaN" => [Function],
+ "has_own_property" => [Function],
+ "alert" => [Function],
+ "timed" => [Function],
+ },
+ "evaller": [Function],
+ "loadedModuleTypes": Object {},
+ "loadedModules": Object {},
+ "maxExecTime": 1000,
+ "operators": Map {
+ "throwIfTimeout" => [Function],
+ "callIfFuncAndRightArgs" => [Function],
+ "boolOrErr" => [Function],
+ "unaryOp" => [Function],
+ "evaluateUnaryExpression" => [Function],
+ "binaryOp" => [Function],
+ "evaluateBinaryExpression" => [Function],
+ "callIteratively" => [Function],
+ "wrap" => [Function],
+ "setProp" => [Function],
+ "getProp" => [Function],
+ },
+ "previousProgramsIdentifiers": Set {
+ "equal",
+ "$length",
+ "length",
+ "$map",
+ "map",
+ "$build_list",
+ "build_list",
+ "for_each",
+ "$list_to_string",
+ "list_to_string",
+ "$reverse",
+ "reverse",
+ "$append",
+ "append",
+ "member",
+ "$remove",
+ "remove",
+ "$remove_all",
+ "remove_all",
+ "$filter",
+ "filter",
+ "$enum_list",
+ "enum_list",
+ "list_ref",
+ "$accumulate",
+ "accumulate",
+ "__access_named_export__",
+ "__access_export__",
+ "stream_tail",
+ "is_stream",
+ "list_to_stream",
+ "stream_to_list",
+ "stream_length",
+ "stream_map",
+ "build_stream",
+ "stream_for_each",
+ "stream_reverse",
+ "stream_append",
+ "stream_member",
+ "stream_remove",
+ "stream_remove_all",
+ "stream_filter",
+ "enum_stream",
+ "integers_from",
+ "eval_stream",
+ "stream_ref",
+ },
+ },
+ "numberOfOuterEnvironments": 1,
+ "prelude": null,
+ "previousPrograms": Array [
+ Object {
+ "body": Array [
+ Node {
+ "end": 21,
+ "expression": Node {
+ "computed": false,
+ "end": 20,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "object": Node {
+ "end": 17,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 17,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 1,
+ "line": 1,
+ },
+ },
+ "properties": Array [
+ Node {
+ "computed": false,
+ "end": 8,
+ "key": Node {
+ "end": 5,
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "raw": "'a'",
+ "start": 2,
+ "type": "Literal",
+ "value": "a",
+ },
+ "kind": "init",
+ "loc": SourceLocation {
+ "end": Position {
+ "column": 8,
+ "line": 1,
+ },
+ "start": Position {
+ "column": 2,
+ "line": 1,
+ },
+ },
+ "method": false,
+ "shorthand": false,
+ "start": 2,
+ "type": "Property",
+